<template>
  <div style="background-color: #f4f7fa;" v-loading="ccisCustomerCodeListFlagLoading">
    <!--      v-if="isShow && !ccisCustomerCodeListFlagLoading"-->
    <div class="search-container">
      <el-collapse-transition>
        <!--              v-show="searchShow"-->
        <div>
          <div class="stock" style="margin-top: 25px; position: relative;">
            <div id="mat-container" class="warehouse-container flex"
                 style="width: 100%; position: relative;overflow-x: auto">
              <div class="warehouse-item"
                   :class="planStatus == 1 ? ' warehouse-item__checked' : 'warehouse-item__not-checked'"
                   style="height: 100px; padding-bottom: 10px" @click="matClick(1)">
                <p
                  style="height: 31px; text-overflow: ellipsis;font-weight: 700;font-size: 16px;overflow: hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;">
                  入库计划
                </p>
                <p class="flex" style="justify-content: space-between;align-items: center;">
                  <span style="color: rgba(0, 0, 0, 0.35);">未完成(柜)</span>
                  <span style="font-weight: 700;font-size: 16px;">{{ boxNumR }} </span>
                </p>
                <p class="flex" style="justify-content: space-between;align-items: center;">
                  <span style="color: rgba(0, 0, 0, 0.35);">重量(吨)</span>
                  <span style="font-weight: 700;font-size: 16px;">{{ (WeightR * 1 / 1000).toFixed(3) }} </span>
                </p>
              </div>
              <div class="warehouse-item"
                   :class="planStatus == 2 ? ' warehouse-item__checked' : 'warehouse-item__not-checked'"
                   style="height: 100px; padding-bottom: 10px" @click="matClick(2)">
                <p
                  style="height: 31px; text-overflow: ellipsis;font-weight: 700;font-size: 16px;overflow: hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;">
                  出库计划
                </p>
                <p class="flex" style="justify-content: space-between;align-items: center;">
                  <span style="color: rgba(0, 0, 0, 0.35);">未完成(车)</span>
                  <span style="font-weight: 700;font-size: 16px;">{{ runningNumC }} </span>
                </p>
                <p class="flex" style="justify-content: space-between;align-items: center;">
                  <span style="color: rgba(0, 0, 0, 0.35);">柜数(柜) | 重量(吨)</span>
                  <span style="font-weight: 700;font-size: 16px;">{{ boxNumC }} | {{
                      (WeightC * 1 / 1000).toFixed(3)
                    }}</span>
                </p>
              </div>
            </div>
          </div>
        </div>
      </el-collapse-transition>
      <div class="bottom-btn" @click="searchShow = !searchShow">
        <Icon type="ios-menu" class="ios-menu"/>
      </div>
      <div class="bottom-btn2" style="left: calc(50% - 1px)">
      </div>
    </div>

    <div class="content-container" style="height: auto;">
      <div class="nav-tab" v-if="wareSelected != ''">
        <!-- <Menu ref="wareMenu" mode="horizontal" style="font-weight: 700;color:#000;padding: 0 30px; height: 70px" :active-name="menuActiveName" @on-select="menuSelect"> -->
        <Menu ref="wareMenu" mode="horizontal" style="font-weight: 700;color:#000;padding: 0 30px; height: 70px"
              :active-name="this.menuActiveName" @on-select="menuSelect">
          <MenuItem v-for="(item, index) in wareList" v-show="item.checked"
                    :key="index" :name="item.id">
            <p style="height: 20px">{{ item.whName }}</p>
            <p style="height: 20px" v-if="planStatus == 1">( {{ thousandthPercentile(completeOrderInfoH[index] || 0) }}
              柜)</p>
            <p style="height: 20px" v-if="planStatus == 2">( {{ thousandthPercentile(completeOrderInfoH[index] || 0) }}
              车)</p>
          </MenuItem>
        </Menu>
      </div>
      <div style="margin-left: 30px; margin-top: 5px" v-if="wareSelected != ''">
        <Form :label-width="100">
          <Row>
            <Col span="3">
              <Input v-if="(planStatus == 1 || planStatus == 2)" v-model="tableData.searchKey"
                     placeholder="请输入商品品名、箱号、车号查询" @on-enter="searchKeyInfo"></Input>
              <Input v-if="planStatus == 3" v-model="tableData.searchKey" placeholder="请输入品名、箱号查询"
                     @on-enter="searchKeyInfo"></Input>
              <Input v-if="planStatus == 4" v-model="tableData.searchKey" placeholder="请输入箱号查询"
                     @on-enter="searchKeyInfo"></Input>
            </Col>
            <Col v-if="$utils.getUserInfo().currentAgentPermission" span="5">
              <FormItem label="货权方：" style="margin-right: 5px">
                <Select
                  v-model="searchForm.ownerCodeList"
                  multiple filterable collapse-tags
                  size="mini"
                  style="width: 100%"
                >
                  <Option
                    v-for="item in $utils.getUserInfo().customerInfoList || []"
                    :key="item.customerPartyID"
                    :value="item.customerPartyCode"
                    :label="item.customerPartyName"
                  />
                </Select>
              </FormItem>
            </Col>
            <Col span="4" v-if="wareSelected != ''">
              <FormItem label="计划状态：" style="margin-bottom: 0;margin-right: 5px">
                <Select v-model="searchForm.inPlanOrderStatus" multiple transfer clearable @change="statusChange">
                  <Option v-for="item in columnsAddList" :key="item.lcatValue" :value="item.lcatValue">
                    {{ item.lcatName }}
                  </Option>
                </Select>
              </FormItem>
            </Col>
            <Col span="5" v-if="planStatus == 1">
              <FormItem label="预计到达时间：" style="margin-bottom: 0;margin-right:5px">
                <DatePicker v-model="searchForm.startArrivedDate" style="width: 100%" type="daterange"
                            transfer></DatePicker>
              </FormItem>
            </Col>
            <Col span="5" v-if="planStatus == 2">
              <FormItem label="预计提货日期：" style="margin-bottom: 0;margin-right:5px">
                <DatePicker v-model="searchForm.expectedDelivery" style="width: 100%" type="daterange"
                            transfer></DatePicker>
              </FormItem>
            </Col>
            <Col span="5" v-if="planStatus == 1">
              <FormItem label="入库日期：" style="margin-bottom: 0;margin-right:5px">
                <DatePicker v-model="searchForm.endRegisterDate" style="width: 100%" type="daterange"
                            transfer></DatePicker>
              </FormItem>
            </Col>
            <Col span="5" v-if="planStatus == 2">
              <FormItem label="出库日期：" style="margin-bottom: 0;margin-right:5px">
                <DatePicker v-model="searchForm.exWarehouse" style="width: 100%" type="daterange" transfer></DatePicker>
              </FormItem>
            </Col>
            <Col span="5" v-if="(planStatus == 1 || planStatus == 2) && menuActiveName == 36">
              <FormItem label="计划号：" style="margin-bottom: 0;margin-right:5px">
                <Input v-if="(planStatus == 1 || planStatus == 2) && menuActiveName == 36"
                       v-model="searchForm.planOrderNumList" placeholder="请输入完整计划号，多个使用逗号隔开"
                       style="width: 250px;margin-top: 5px;margin-right:30px;z-index:100" @on-enter="searchKeyInfo"
                       size="small"></Input>
              </FormItem>
            </Col>
            <Col span="4" v-if="planStatus == 3">
              <FormItem label="货转日期：" style="margin-bottom: 0;margin-right:5px">
                <DatePicker v-model="searchForm.goodsTransfer" type="daterange" transfer></DatePicker>
              </FormItem>
            </Col>
            <Col span="4" v-if="planStatus == 4">
              <FormItem label="分色日期：" style="margin-bottom: 0;margin-right:5px">
                <DatePicker v-model="searchForm.colorSeparation" type="daterange" transfer></DatePicker>
              </FormItem>
            </Col>
            <Col span="4" v-if="planStatus == 4">
              <FormItem label="分色类型：" style="margin-bottom: 0;margin-right:5px">
                <Select v-model="searchForm.businessType" size="mini" transfer clearable>
                  <Option v-for="item in colorSeparationTypeList" :key="item.value" :value="item.value">
                    {{ item.label }}
                  </Option>
                </Select>
              </FormItem>
            </Col>
          </Row>
        </Form>
        <div style="text-align: right; margin-right: 40px">
          <Button v-if="planStatus == 2" style="margin-left: 5px;" type="primary" @click="creteadInfo">新增</Button>
          <Button v-if="wareSelected.length > 0 && this.menuActiveName == 36 && (planStatus == 1 || planStatus == 2)"
                  style="margin-left: 5px;" type="primary" @click="searchKeyInfo">查询
          </Button>
          <Button v-if="wareSelected.length > 0 && this.menuActiveName == 36 && (planStatus == 1 || planStatus == 2)"
                  style="margin-left: 5px;" type="primary" @click="reset">重置
          </Button>
          <Button v-if="wareSelected.length > 0 && this.menuActiveName == 36 && (planStatus == 3 || planStatus == 4)"
                  style="margin-left: 5px;" type="primary" @click="searchKeyInfo">查询
          </Button>
          <Button v-if="wareSelected.length > 0 && this.menuActiveName == 36 && (planStatus == 3 || planStatus == 4)"
                  style="margin-left: 5px;" type="primary" @click="reset">重置
          </Button>
          <Button v-if="wareSelected.length > 0 && this.menuActiveName != 36" style="margin-left: 5px;" type="primary"
                  @click="searchKeyInfo">查询
          </Button>
          <Button v-if="wareSelected.length > 0 && this.menuActiveName != 36" style="margin-left: 5px;" type="primary"
                  @click="reset">重置
          </Button>
        </div>
        <!-- <span style="color: #4F68E8;cursor: pointer;margin-left: 10px;">
                    <Poptip trigger="click" title="" content="content" placement="left">
                        高级查询
                        <Icon type="ios-arrow-down" />
                        <div slot="title" style="overflow: hidden;">
                            <div style="float: right;">
                                <Button size="small" @click="searchRest">重置</Button>
                                <Button style="margin-left: 10px" type="primary" size="small" @click="search">查询</Button>
                            </div>
                        </div>
                        <div slot="content">

                        </div>
                    </Poptip>
                </span> -->
      </div>
      <div class="content" style="height: calc(100vh - 230px);overflow: auto;" v-loading="tableData.loading">
        <template v-if="tableData.list && tableData.list.length > 0 && wareSelected != ''">
          <Card v-for="(item, index) in tableData.list" v-if="planStatus == 1" :key="index"
                style="margin-bottom: 10px;">
            <div v-if="menuActiveName == 37">
              <div v-if="(columnsInPlanNB.filter(a => a.lcatValue == item.status)[0].lcatName === '草稿')"
                   style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(111,199,123);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                草稿
              </div>
              <div v-if="(columnsInPlanNB.filter(a => a.lcatValue == item.status)[0].lcatName === '已提交')"
                   style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(9,121,80);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                已提交
              </div>
              <el-tooltip class="item" effect="dark" :content="'驳回原因：' + item.refuseRemark" placement="top">
                <div v-if="(columnsInPlanNB.filter(a => a.lcatValue == item.status)[0].lcatName === '驳回')"
                     style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(246,143,66);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  驳回
                </div>
              </el-tooltip>
              <div v-if="(columnsInPlanNB.filter(a => a.lcatValue == item.status)[0].lcatName === '未开始')"
                   style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(69,121,250);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                未开始
              </div>
              <div v-if="(columnsInPlanNB.filter(a => a.lcatValue == item.status)[0].lcatName === '进行中')"
                   style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(121,138,255);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                进行中
              </div>
              <div v-if="(columnsInPlanNB.filter(a => a.lcatValue == item.status)[0].lcatName === '已完成')"
                   style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(15,178,215);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                已完成
              </div>
            </div>
            <div v-else>
              <div v-if="item.id === null && item.status">
                <div
                  v-if="item.id === null && columns.filter(a => a.lcatValue == item.status)[0].lcatName === '已创建' || columns.filter(a => a.lcatValue == item.status)[0].lcatName === '到货登记'"
                  style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(69,121,250);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  未开始
                </div>
                <div
                  v-if="item.id === null && columns.filter(a => a.lcatValue == item.status)[0].lcatName === '开始作业'"
                  style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(121,138,255);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  进行中
                </div>
                <div
                  v-if="columns.filter(a => a.lcatValue == item.status)[0].lcatName === '作业完成' || columns.filter(a => a.lcatValue == item.status)[0].lcatName === '入库完成' || columns.filter(a => a.lcatValue == item.status)[0].lcatName === '异常完结' || columns.filter(a => a.lcatValue == item.status)[0].lcatName === '作业异常'"
                  style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(15,178,215);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  已完成
                </div>
              </div>
              <div v-if="item.id !== null && item.status">
                <div v-if="item.id !== null && columnNew.filter(a => a.lcatValue == item.status)[0].lcatName === '草稿'"
                     style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(111,199,123);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  {{ columnNew.filter(a => a.lcatValue == item.status)[0].lcatName }}
                </div>
                <div
                  v-if="item.id !== null && columnNew.filter(a => a.lcatValue == item.status)[0].lcatName === '已提交'"
                  style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(9,121,80);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  {{ columnNew.filter(a => a.lcatValue == item.status)[0].lcatName }}
                </div>
                <el-tooltip class="item" effect="dark" :content="'驳回原因：' + item.refuseRemark" placement="top">
                  <div
                    v-if="item.id !== null && columnNew.filter(a => a.lcatValue == item.status)[0].lcatName === '驳回'"
                    style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(246,143,66);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                    {{ columnNew.filter(a => a.lcatValue == item.status)[0].lcatName }}
                  </div>
                </el-tooltip>
                <div
                  v-if="item.id !== null && columnNew.filter(a => a.lcatValue == item.status)[0].lcatName === '申请成功'"
                  style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(15,178,218);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  {{ columnNew.filter(a => a.lcatValue == item.status)[0].lcatName }}
                </div>
              </div>
            </div>
            <div @click.stop="activeInfo(item)">
              <div slot="title">
                <Row>
                  <i-col :span="24">
                    <span style="font-weight: 700;">箱号：{{ item.containerNum }}</span>
                  </i-col>
                </Row>
                <Row>
                  <!-- <i-col :span="2" style="font-weight: 700; text-align: center">
                                    <el-tag size='mini' v-if="planStatus == 1">{{columns.filter(a => a.lcatValue == item.inPlanOrderStatus)[0].lcatName}}</el-tag>
                                </i-col> -->
                  <i-col :span="4" style="font-weight: 700;">
                    <p>预计到达时间：{{ $utils.timestampToDate(item.inEstimateDate) }}</p>
                  </i-col>
                  <i-col :span="3" style="font-weight: 700;">
                    <span>送货车号：</span>
                    <span>{{ item.carNo }}</span>
                  </i-col>
                  <i-col :span="5" style="font-weight: 700;">
                    <p>送货司机：{{ item.driver }}/{{ item.driverTel }}</p>
                  </i-col>
                  <i-col :span="3" style="font-weight: 700;">
                    <!-- <p>入库日期：{{ $utils.timestampToDate(item.businessDate) }}</p> -->
                    <p>入库日期：{{ $utils.timestampToDate(item.startInTime) }}</p>
                  </i-col>
                  <i-col :span="4" style="font-weight: 700;">
                    <p>业务员：{{ item.businessPersonal }}/{{ item.businessTel }}</p>
                  </i-col>
                </Row>
              </div>
              <hr style="margin: 15px 0">
              <Row style="margin-bottom: 10px">
                <i-col v-if="belongUserCustomerList.length" :span="3">
                  <span class="font-bold">结算客户：</span>
                  <span class="font-bold" v-if="item.id === null">{{ agentPermission(item.settlementCustomer) }}</span>
                  <span class="font-bold" v-if="item.id !== null">{{ agentPermission(item.settlementCustomer) }}</span>
                </i-col>
                <i-col v-else :span="3">
                  <span class="font-bold">结算客户：</span>
                  <span class="font-bold" v-if="item.id === null">{{
                      item.settlementCustomer === $utils.getUserInfo().entrustingPartyName ? 'Y' : 'N'
                    }}</span>
                  <span class="font-bold" v-if="item.id !== null">{{
                      item.settlementCustomer === $utils.getUserInfo().entrustingPartyName ? 'Y' : 'N'
                    }}</span>
                </i-col>
                <i-col :span="5">
                  <span class="font-bold">货主：</span>
                  <span class="font-bold">{{ item.customerName }}</span>
                </i-col>
                <i-col :span="3">
                  <span class="font-bold">计划件数(件)：</span>
                  <span class="font-bold">{{ item.sumOrderQty }} </span>

                </i-col>
                <i-col :span="4">
                  <span class="font-bold">计划重量(KGS)：</span>
                  <span class="font-bold">{{ thousandthPercentile(item.sumOrderWeight || 0) }}</span>

                </i-col>
                <i-col :span="3">
                  <span class="font-bold">实际件数(件)：</span>
                  <span class="font-bold">{{ item.finishQty }} </span>

                </i-col>
                <i-col :span="4">
                  <span class="font-bold">实际重量(KGS)：</span>
                  <span class="font-bold">{{ item.finishWeight ? item.finishWeight : '' }}</span>
                </i-col>
                <div style="position:absolute;right:0px;margin-right:50px; top: -10px;z-index:1000">
                  <Dropdown v-if="item.id !== null && item.status !== '1' " placement="bottom-end">
                    <a href="javascript:void(0)" style="color: #4F68E8;">
                      操作
                      <i class="el-icon-arrow-down el-icon--right"></i>
                    </a>
                    <DropdownMenu slot="list">
                      <DropdownItem class="font-bold" @click.native.stop="EditInfo(item)">编辑</DropdownItem>
                      <DropdownItem class="font-bold" @click.native.stop="submitInfo(item)">提交</DropdownItem>
                      <DropdownItem class="font-bold" @click.native.stop="delectInfo(item)">删除</DropdownItem>
                    </DropdownMenu>
                  </Dropdown>
                </div>
                <i-col :span="1"
                       style="position:absolute; right: 0; margin-right:54px; margin-top: 20px; top: 20px; z-index:100"
                       v-if="planStatus == 1 && item.fileCount != 0">
                  <el-button class="colorInfo" type="text" @click="getViewInfo(item)">查看附件</el-button>
                </i-col>
                <i-col :span="1" style="position:absolute; right: 0; margin-right:54px; margin-top: 20px; top: -10px"
                       v-if="planStatus == 2 && item.fileCount != 0">
                  <el-button class="colorInfo" type="text" @click="getViewInfo(item)">查看附件</el-button>
                </i-col>
                <i-col :span="1" style="position:absolute; right: 0; margin-right:55px; margin-top: 20px; top: -10px"
                       v-if="item.id !== null && item.status !== '1'">
                  <el-button type="text" @click="inPlanInfoD(item,'in')"><span
                    class="colorInfo">{{ !item.dtailInfo ? '展开详情' : '收起详情' }}  </span><i class="colorInfo"
                                                                                                 :class="!item.dtailInfo ? 'el-icon-arrow-right' : 'el-icon-arrow-down'"></i>
                  </el-button>
                </i-col>
                <i-col :span="1" style="position:absolute; right: 0; margin-right:55px;"
                       v-if="!(item.id !== null && item.status !== '1')">
                  <el-button type="text" @click="inPlanInfoD(item,'in')"><span
                    class="colorInfo">{{ !item.dtailInfo ? '展开详情' : '收起详情' }} </span><i class="colorInfo"
                                                                                                :class="!item.dtailInfo ? 'el-icon-arrow-right' : 'el-icon-arrow-down'"></i>
                  </el-button>
                </i-col>
              </Row>
              <Row style="margin-bottom: 10px">
                <i-col :span="3">
                  <span class="font-bold">提单号：</span>
                  <span class="font-bold" v-if="item.id == null"> {{
                      item.billOfLandingNo ? item.billOfLandingNo : '--'
                    }}</span>
                  <span class="font-bold" v-if="item.id != null"> {{
                      item.billOfLandingNo ? item.billOfLandingNo : '--'
                    }}</span>
                </i-col>
                <i-col :span="4" v-if="menuActiveName == 27">
                  <span class="font-bold">报关单号：</span>
                  <span class="font-bold"> {{ item.businessNum ? item.businessNum : '--' }}</span>

                </i-col>
                <i-col :span="3" v-if="menuActiveName == 27">
                  <span class="font-bold">船名：</span>
                  {{ item.shipName ? item.shipName : '--' }}
                </i-col>
                <i-col :span="4" v-if="menuActiveName == 27">
                  <span class="font-bold">航次：</span>
                  {{ item.voyageNum ? item.voyageNum : '--' }}
                </i-col>
                <i-col :span="3" v-if="menuActiveName == 27">
                  <span class="font-bold">合同号：</span>
                  {{ item.contractNo ? item.contractNo : '--' }}
                </i-col>
                <i-col :span="5">
                  <span class="font-bold">作业要求：</span>
                  <span>
                                       {{
                      item.intoSeparationChargeSign ? item.intoSeparationChargeSign != 0 ? '分色' : '' : ''
                    }}
                                       {{ item.nucleicAcidTestFlag ? item.nucleicAcidTestFlag != 0 ? '核酸检测' : '' : '' }}
                                       {{ item.disinfectionSign ? item.disinfectionSign != 'N' ? "消毒" : '' : '' }}
                                       {{ item.authenticateFlag ? item.authenticateFlag != 0 ? "密钥" : '' : '' }}
                                       {{ item.ifCodeReading ? item.ifCodeReading != 0 ? "抄码" : '' : '' }}
                                     </span>
                </i-col>
                <i-col :span="4">
                  <span class="font-bold">计划号：</span>
                  {{ item.orderNum }}
                </i-col>
<!--                <i-col :span="4">-->
<!--                  <span class="font-bold">附件数：</span>-->
<!--                  <span>{{ item.fileCount }}</span>-->
<!--                </i-col>-->
                <i-col :span="4">
                  <span class="font-bold">流转：</span>
                  <span>{{ item.originType }}</span>
                </i-col>
                <i-col :span="4">
                  <span class="font-bold">创建人：</span>
                  <span>{{ item.createdByName }}</span>
                </i-col>
              </Row>
              <Row style="margin-bottom: 10px">
                <i-col :span="4">
                  <span class="font-bold">报税性质：</span>
                  <span>{{ goodsBondedPropertyObj[item.goodsBondedProperty] }}</span>
                </i-col>
                <i-col :span="4">
                  <span class="font-bold">业务备注：</span>
                  <span>{{ item.remark }}</span>
                </i-col>

              </Row>
              <div v-if="item.dtailInfo && !item.id" style="margin-bottom:15px">
                <p slot="header">进度详情</p> <br>
                <div v-if="item.BusiList" style="padding:10px">
                  <el-steps :active="item.BusiList.length">
                    <el-step :title="computedBusinessName(item.BusiList[0], '计划创建')"
                             :description="computedBusiness(item.BusiList[0])"></el-step>
                    <el-step :title="computedBusinessName(item.BusiList[1], '车辆到达')"
                             :description="computedBusiness(item.BusiList[1])"></el-step>
                    <el-step :title="computedBusinessName(item.BusiList[2], '到货登记')"
                             :description="computedBusiness(item.BusiList[2])"></el-step>
                    <el-step :title="computedBusinessName(item.BusiList[3], '开始作业')"
                             :description="computedBusiness(item.BusiList[3])"></el-step>
                    <el-step :title="computedBusinessName(item.BusiList[4], '作业完成')"
                             :description="computedBusiness(item.BusiList[4])"></el-step>
                    <el-step :title="computedBusinessName(item.BusiList[5], '离开园区')"
                             :description="computedBusiness(item.BusiList[5])"></el-step>
                  </el-steps>
                </div>
                <div v-else>暂无作业进度</div>
              </div>
              <Row v-if="item.dtailInfo">
                <Row style="margin-bottom: 10px" v-for="(goods,index) in item.warehousing" :key="index">
                  <el-card style="margin: 10px 0;padding: 0 0 15px;background-color: #F4F8FA">
                    <i-col :span="4">
                      <span>品类：</span>
                      <span>{{ goods.matTypCode }}</span>
                    </i-col>
                    <i-col :span="4">
                      <span>商品描述：</span>
                      {{ goods.matName }}
                    </i-col>
                    <i-col :span="4">
                      <span>商品描述：</span>
                      {{ goods.matName }}
                    </i-col>
                    <i-col :span="4">
                      <span>外部批次：</span>
                      {{ goods.batchNum }}
                    </i-col>
                    <i-col :span="4">
                      <span>厂号：</span>
                      {{ goods.factoryCode }}
                    </i-col>
                    <i-col :span="4">
                      <span>产品规格：</span>
                      {{ goods.packFormat }}
                    </i-col>
                    <i-col :span="4">
                      <span>生产日期：</span>
                      {{ $utils.timestampToDate(goods.dateGen) }}
                    </i-col>
                    <i-col :span="4">
                      <span>失效日期：</span>
                      {{ goods.dateGen != null ? $utils.timestampToDate(goods.dateExpire) : '' }}
                    </i-col>
                    <!-- <i-col :span="4">
                                          <span>商品编码：</span>
                                          {{ goods.matCode }}
                                      </i-col> -->
                    <i-col :span="4">
                      <span>计划件数(件)：{{ goods.orderQty }} </span>
                    </i-col>
                    <i-col :span="4">
                      <span>计划重量(KGS)：{{ thousandthPercentile(goods.orderWeight ? goods.orderWeight : 0) }} </span>
                    </i-col>
                    <i-col :span="4">
                      <span>实际件数(件)：{{ goods.finishQty ? goods.finishQty : 0 }} </span>
                    </i-col>
                    <i-col :span="4">
                      <span>实际重量(KGS)：{{ thousandthPercentile(goods.warehousedWeight ? goods.warehousedWeight : 0) }}</span>
                    </i-col>
                    <!-- <i-col :span="4">
                                          <span>产品状态：</span>
                                              <el-tag size='mini' v-if="goods.productStatus == 1">正品</el-tag>
                                              <el-tag size='mini' v-if="goods.productStatus == 2">不良品</el-tag>
                                              <el-tag size='mini' v-if="goods.productStatus == 3">退货正品</el-tag>
                                              <el-tag size='mini' v-if="goods.productStatus == 4">破箱</el-tag>
                                      </i-col> -->
                    <i-col :span="4">
                      <span>破损件数(件)：{{ goods.badBoxNum }}</span>
                    </i-col>
                    <i-col :span="4">
                      <span>抄码件数(件)：{{ goods.codeQty ? goods.codeQty : 0 }}</span>
                    </i-col>
                    <i-col :span="4">
                      <span>抄码重量(KGS)：{{ goods.scanSnWeight ? goods.scanSnWeight : 0 }}</span>
                    </i-col>
                    <i-col :span="3" v-if="menuActiveName == 27">
                      <span>批次号：</span>
                      {{ goods.batchNum ? goods.batchNum : '--' }}
                    </i-col>
                  </el-card>
                </Row>
              </Row>
            </div>

          </Card>
          <Card v-for="(item, index) in tableData.list" v-if="planStatus == 2" :key="index" style="margin-bottom: 10px">
            <template v-if="menuActiveName == 37">
              <div v-if="item.approveStatus == 1 || item.approveStatus == null">
                <div
                  v-if="(columnsNB.filter(a => a.lcatValue == item.status)[0].lcatName === '已创建' || columnsNB.filter(a => a.lcatValue == item.status)[0].lcatName === '提货登记')"
                  style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(69,121,250);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  未开始
                </div>
                <div
                  v-if="(columnsNB.filter(a => a.lcatValue == item.status)[0].lcatName === '发货中' || columnsNB.filter(a => a.lcatValue == item.status)[0].lcatName === '部分完成' || columnsNB.filter(a => a.lcatValue == item.status)[0].lcatName === '发货完成')"
                  style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(121,138,255);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  进行中
                </div>
                <div v-if="(columnsNB.filter(a => a.lcatValue == item.status)[0].lcatName === '已关单')"
                     style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(15,178,215);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  已完成
                </div>
              </div>
              <div
                v-if="(item.status == '00' && (item.approveStatus == 0 || item.approveStatus == 2)) || item.status == '-1' ">
                <div v-if="(columnsNB.filter(a => a.lcatValue == item.approveStatus)[0].lcatName === '草稿')"
                     style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(111,199,123);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  {{ columnsNB.filter(a => a.lcatValue == item.approveStatus)[0].lcatName }}
                </div>
                <div v-if="columnsNB.filter(a => a.lcatValue == item.approveStatus)[0].lcatName === '已提交'"
                     style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(9,121,80);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  {{ columnsNB.filter(a => a.lcatValue == item.approveStatus)[0].lcatName }}
                </div>
                <div v-if="columnsNB.filter(a => a.lcatValue == item.approveStatus)[0].lcatName === '取消'"
                     style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(9,121,80);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  {{ columnsNB.filter(a => a.lcatValue == item.approveStatus)[0].lcatName }}
                </div>
                <div v-if="columnsNB.filter(a => a.lcatValue == item.approveStatus)[0].lcatName === '审批通过'"
                     style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(9,121,80);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  {{ columnsNB.filter(a => a.lcatValue == item.approveStatus)[0].lcatName }}
                </div>
                <div v-if="columnsNB.filter(a => a.lcatValue == item.approveStatus)[0].lcatName === '驳回'"
                     style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(246,143,66);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  {{ columnsNB.filter(a => a.lcatValue == item.approveStatus)[0].lcatName }}
                </div>
              </div>
            </template>
            <template v-else>
              <div
                v-if="columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '已审批' || columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '等待出库'"
                style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(69,121,250);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                未开始
              </div>
              <div
                v-if="columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '移动下架' ||  columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '部分拣货'"
                style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(121,138,255);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                进行中
              </div>
              <div
                v-if="columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '出库完成' || columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '异常完结' || columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '作业完成' || columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '作业异常'"
                style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(15,178,215);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                已完成
              </div>
              <div v-if="columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '草稿'"
                   style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(111,199,123);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                草稿
              </div>
              <div
                v-if="columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '已提交' || columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '已创建'"
                style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(9,121,80);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                已提交
              </div>
              <el-tooltip class="item" effect="dark" :content="'驳回原因：' + item.reason" placement="top">
                <div v-if="columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '驳回'"
                     style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(246,143,66);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">
                  驳回
                </div>
              </el-tooltip>
              <!--                          <div v-if="columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '异常完结' || columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName === '异常完结中’" style="position: absolute; right: 0; top: 0;width: 80px; height: 30px;background-color:rgb(190,19,19);border-radius: 0px 0px 0px 30px;color:rgb(255,255,255);line-height: 30px;text-align: center;">-->
              <!--                            异常-->
              <!--                          </div>-->
            </template>
            <div @click.stop="activeInfo(item)">
              <div slot="title">
                <Row>
                  <i-col :span="24">
                    <span style="font-weight: 700;">箱号：{{ item.containerNum }}</span>
                  </i-col>
                </Row>
                <Row>
                  <i-col :span="3" style="font-weight: 700;">
                    <p>提货车号：{{ item.carNo }}</p>
                  </i-col>
                  <!-- <i-col :span="2" style="font-weight: 700; text-align: center">
                                    <el-tag size='mini'>{{columnsTwo.filter(a => a.lcatValue == item.status)[0].lcatName}}</el-tag>
                                </i-col> -->

                  <i-col :span="4" style="font-weight: 700; text-align: center">
                    <p>预计提货时间：{{ $utils.timestampToDate(item.outEstimateDate) }}</p>
                  </i-col>
                  <i-col :span="4" style="font-weight: 700; text-align: center">
                    <p>送货司机：{{ item.driver }}/{{ item.tel }}</p>
                  </i-col>
                  <i-col :span="3" style="font-weight: 700; text-align: center">
                    <p>出库日期：{{ $utils.timestampToDate(item.outStartDate) }}</p>
                    <!-- <p>入库日期：{{ $utils.timestampToDate(item.registerDate) }}</p> -->
                  </i-col>
                  <i-col :span="4" style="font-weight: 700; text-align: center;">
                    <p>业务员：{{ item.createdByName }}/{{ item.createdByMobile }}</p>
                  </i-col>
                </Row>
              </div>
              <hr style="margin: 15px 0">
              <Row style="margin-bottom: 10px;position: relative;">
                <i-col :span="5">
                  <span class="font-bold">货主：</span>
                  {{ item.cargoOwnerName }}
                </i-col>
                <i-col :span="2">
                  <span class="font-bold">结算客户：</span>
                  {{ item.settlementCustomerName === $utils.getUserInfo().entrustingPartyName ? 'Y' : 'N' }}
                </i-col>
                <i-col :span="2">
                  <span class="font-bold">计划件数：</span>
                  {{ item.sumOutQty }}
                </i-col>
                <i-col :span="4">
                  <span class="font-bold">计划重量(KGS)：</span>
                  {{ thousandthPercentile(item.sumOutWeight || 0) }}
                </i-col>
                <i-col :span="2">
                  <span class="font-bold">实际件数：</span>
                  {{ thousandthPercentile(item.sumFinishQty) }}
                </i-col>
                <i-col :span="4">
                  <span class="font-bold">实际重量(KGS)：</span>
                  {{ thousandthPercentile(item.realWorkWeight || 0) }}
                </i-col>
<!--                <i-col :span="2">-->
<!--                  <span class="font-bold">附件数：</span>-->
<!--                  <span>{{ item.fileCount }}</span>-->
<!--                </i-col>-->
                <i-col :span="4">
                  <span class="font-bold">计划号：</span>
                  {{ item.outPlanOrderNum }}
                </i-col>
                <i-col :span="5" style="margin-top: 10px;">
                  <span class="font-bold">作业要求：</span>
                  <span>
                                    {{ item.escort != 0 && item.escort != null ? '押车' : '' }}
                                    {{ item.isScanSn != 0 && item.isScanSn != null ? '抄码' : '' }}
                                    {{ item.separation != 0 && item.separation != null ? '分色' : '' }}
                                </span>
                </i-col>
                <i-col :span="4" style="margin-top: 10px;">
                  <span class="font-bold">流转：</span>
                  <span>{{ item.originType }}</span>
                </i-col>
                <i-col :span="3" style="margin-top: 10px;">
                  <span class="font-bold">创建人：</span>
                  <span>{{ item.createdByName }}</span>
                </i-col>
                <i-col :span="4" style="margin-top: 10px;">
                  <span class="font-bold">业务备注：</span>
                  <span>{{ item.remark }}</span>
                </i-col>
                <i-col :span="3" style="margin-top: 10px;">
                  <span class="font-bold">是否押车：</span>
                  <span>{{ item.escort ? (item.escort=== '1' ? '是' : '否') : '' }}</span>
                </i-col>
                <i-col :span="4" style="margin-top: 10px;">
                  <span class="font-bold">放行状态：</span>
                  <span>{{ item.escortRelease ? (item.escortRelease === '1' ? '已放行' : '未放行') : '' }}</span>
                </i-col>
                <div style="position:absolute;right:0px;margin-right:50px; top: -10px;z-index:1000">
                  <Dropdown v-if="item.id !== null && item.status !== '1' && item.approveStatus != 0">
                    <a href="javascript:void(0)" style="color: #4F68E8;" placement="bottom-end">
                      操作
                      <i class="el-icon-arrow-down el-icon--right"></i>
                    </a>
                    <DropdownMenu slot="list">
                      <DropdownItem @click.native="EditInfoCK(item)">编辑</DropdownItem>
                      <DropdownItem @click.native="submitApplyCK(item)">提交</DropdownItem>
                      <DropdownItem @click.native="delCcisOutStockApply(item)">删除</DropdownItem>
                    </DropdownMenu>
                  </Dropdown>
                </div>
                <i-col :span="0"
                       style="position:absolute; right: 0; margin-right:54px; margin-top: 20px; top: 20px; z-index: 100;"
                       v-if="planStatus == 2 && item.fileCount != 0">
                  <el-button class="colorInfo" type="text" @click="getViewInfo(item)">查看附件</el-button>
                </i-col>
                <!-- <i-col :span="0" style="position:absolute; right: 0; margin-right:54px; margin-top: 20px; top: -10px" v-if="planStatus == 2 && item.fileCount != 0">
                                <el-button class="colorInfo" type="text" @click="getViewInfo(item)">查看附件</el-button>
                            </i-col> -->
                <i-col :span="0" style="position:absolute; right: 0; margin-right:40px; margin-top: 20px; top: -10px"
                       v-if="item.id !== null && planStatus == 1">
                  <el-button type="text" @click="inPlanInfoD(item, 'out')"><span
                    class="colorInfo">{{ !item.dtailInfo ? '展开详情' : '收起详情' }}</span> <i class="colorInfo"
                                                                                                :class="!item.dtailInfo ? 'el-icon-arrow-right' : 'el-icon-arrow-down'"></i>
                  </el-button>
                </i-col>
                <i-col :span="0" style="position:absolute; right: 0; margin-right:40px;margin-top:-5px"
                       v-if="item.id === null && planStatus == 1">
                  <el-button type="text" @click="inPlanInfoD(item, 'out')"><span
                    class="colorInfo">{{ !item.dtailInfo ? '展开详情' : '收起详情' }}</span> <i class="colorInfo"
                                                                                                :class="!item.dtailInfo ? 'el-icon-arrow-right' : 'el-icon-arrow-down'"></i>
                  </el-button>
                </i-col>
                <i-col :span="0" style="position:absolute; right: 0; margin-right:40px; margin-top: 10px;"
                       v-if="item.id !== null && planStatus == 2">
                  <el-button type="text" @click="inPlanInfoD(item, 'out')"><span
                    class="colorInfo">{{ !item.dtailInfo ? '展开详情' : '收起详情' }}</span> <i class="colorInfo"
                                                                                                :class="!item.dtailInfo ? 'el-icon-arrow-right' : 'el-icon-arrow-down'"></i>
                  </el-button>
                </i-col>
                <i-col :span="0" style="position:absolute; right: 0; margin-right:40px;margin-top: 10px;"
                       v-if="item.id === null && planStatus == 2">
                  <el-button type="text" @click="inPlanInfoD(item, 'out')"><span
                    class="colorInfo">{{ !item.dtailInfo ? '展开详情' : '收起详情' }}</span> <i class="colorInfo"
                                                                                                :class="!item.dtailInfo ? 'el-icon-arrow-right' : 'el-icon-arrow-down'"></i>
                  </el-button>
                </i-col>
              </Row>
              <div v-if="item.dtailInfo && !item.id" style="margin-bottom:15px;padding:10px">
                <div slot="header">进度详情</div>
                <br>
                <div v-if="item.BusiList &&item.BusiList.length > 0 && item.dtailInfo && !item.id">
                  <el-steps :active="item.BusiList.length">
                    <el-step :title="computedBusinessName(item.BusiList[0], '计划创建')"
                             :description="computedBusiness(item.BusiList[0])"></el-step>
                    <el-step :title="computedBusinessName(item.BusiList[1], '车辆到达')"
                             :description="computedBusiness(item.BusiList[1])"></el-step>
                    <el-step :title="computedBusinessName(item.BusiList[2], '提货登记')"
                             :description="computedBusiness(item.BusiList[2])"></el-step>
                    <el-step :title="computedBusinessName(item.BusiList[3], '开始作业')"
                             :description="computedBusiness(item.BusiList[3])"></el-step>
                    <el-step :title="computedBusinessName(item.BusiList[4], '作业完成')"
                             :description="computedBusiness(item.BusiList[4])"></el-step>
                    <el-step :title="computedBusinessName(item.BusiList[5], '离开园区')"
                             :description="computedBusiness(item.BusiList[5])"></el-step>
                  </el-steps>
                </div>
                <div v-else style="font-size: 12px">暂无作业进度</div>
              </div>
              <div v-if="item.dtailInfo">
                <Row style="margin-bottom: 10px" v-for="(keys,index) in item.warehousing" :key="index">
                  <el-card style="margin: 10px 0;background-color: #F4F8FA">
                    <Row>
                      <i-col :span="4">
                        <span>品类：</span>
                        {{ keys.matTypName }}
                      </i-col>
                      <i-col :span="4">
                        <span>商品描述：</span>
                        {{ keys.matName }}
                      </i-col>
                      <i-col :span="4">
                        <span>批次号：</span>
                        {{ keys.wmsBatchNum ? keys.wmsBatchNum : '' }}
                      </i-col>
                      <i-col :span="4">
                        <span>厂号：</span>
                        {{ keys.factoryCode ? keys.factoryCode : '' }}
                      </i-col>
                      <i-col :span="4">
                        <span>产品规格：</span>
                        {{ keys.packName }}
                      </i-col>
                      <i-col :span="4">
                        <span>计划件数(件)：{{thousandthPercentile(keys.planOutNum || 0)}} </span>
                      </i-col>
                      <i-col :span="4">
                        <span>计划重量(KGS)：{{thousandthPercentile(keys.outWeight || 0)}} </span>
                      </i-col>
                      <i-col :span="4">
                        <span>实际件数(件)：{{ thousandthPercentile(keys.finishQty || 0)}} </span>
                      </i-col>
                      <i-col :span="4">
                        <span>实际重量(KGS)：{{ thousandthPercentile(keys.warehousedWeight || 0) }}</span>
                      </i-col>
                      <i-col :span="4">
                        <span>生产日期：</span>
                        {{ $utils.timestampToDate(keys.dateGen) }}
                      </i-col>
                      <i-col :span="4">
                        <span>失效日期：</span>
                        {{ $utils.timestampToDate(keys.dateExpire) }}
                      </i-col>
                      <i-col :span="4">
                        <span>出车顺序：{{ keys.seq }}</span>
                      </i-col>
                      <!-- <i-col :span="4"> -->
                      <!-- <span>产品状态：</span>
                                        <el-tag size='mini' v-if="keys.productStatus == 1">正品</el-tag>
                                        <el-tag size='mini' v-if="keys.productStatus == 2">不良品</el-tag>
                                        <el-tag size='mini' v-if="keys.productStatus == 3">退货正品</el-tag>
                                        <el-tag size='mini' v-if="keys.productStatus == 4">破箱</el-tag> -->
                      <!-- </i-col> -->
                      <i-col :span="4">
                        <span>抄码件数(件)：{{ thousandthPercentile(keys.codeQty || 0) }}</span>
                      </i-col>
                      <i-col :span="4">
                        <span>抄码重量(KGS)：{{ thousandthPercentile(keys.scanSnWeight || 0) }}</span>
                      </i-col>
                    </Row>
                  </el-card>
                </Row>
              </div>
            </div>
          </Card>
        </template>
        <empty-comp v-else></empty-comp>

        <div style="width: 100%; display: flex; justify-content: end;padding-top: 10px;" v-if="wareSelected != ''">
          <Page :total="tableData.total" :current="tableData.pageNum" :page-size="tableData.pageSize"
                :page-size-opts="tableData.pageOptionsList"
                @on-change="pageChange" @on-page-size-change="pageSizeChange" show-sizer show-total></Page>
        </div>
      </div>
      <el-dialog
        :visible.sync="dialogTableVisible"
        :title="dialogTableTitle"
        height="67%"
        width="65%">
        <Row style="margin-top: 10px;">
          <Form :model="attachmentItem" :label-width="50">
            <i-col :span="14">
              <FormItem :label-width="0">
                <el-button type="primary" size="mini" @click="downloadFile" :loading="attachmentLoading">下载
                </el-button>
              </FormItem>
            </i-col>
            <i-col :span="5">
              <FormItem label="关键字">
                <el-input v-model="attachmentItem.searchKey" placeholder="按文件名称模糊查询" size="mini"
                          style="width: 100%;" clearable></el-input>
              </FormItem>
            </i-col>
            <i-col :span="5">
              <FormItem>
                <el-button v-if="menuActiveName === '36'" type="primary" size="mini" @click="getViewInfo(searchItem)">
                  查询
                </el-button>
                <el-button v-else type="primary" size="mini" @click="getViewInfo(selectRowItem)">查询</el-button>
                <el-button type="primary" size="mini" @click="resetAttachment">重置</el-button>
              </FormItem>
            </i-col>
          </Form>
        </Row>
        <el-table :data="pageData.list"
                  v-loading="pageData.loading"
                  height="calc(80vh - 195px)"
                  @selection-change="handleSelectionChange">
          <el-table-column
            type="selection"
            width="36">
          </el-table-column>
          <el-table-column
            label="序号"
            type="index"
            width="50"
            align="center">
          </el-table-column>
          <el-table-column
            v-for="(item, key) in this.planStatus == 1 || this.planStatus == 2 ? column : columnTwo" :key="key"
            :prop="item.key"
            :label="item.title"
            :min-width="item.width"
            align="center"
            :sortable="item.sortable"
            :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <template v-if="item.type !== 'template'">
                {{ $table.tableRowFormat(scope.row, item) }}
              </template>
            </template>
          </el-table-column>
          <el-table-column label="操作" width="100" fixed="right">
            <template slot-scope="scope">
              <a @click="lookFile(scope.row)"><span style="color: #4f68e8">预览</span></a>
            </template>
          </el-table-column>
        </el-table>
        <br>
        <Row class="margin-top-10">
          <Page :total="pageData.total" :current="pageData.pageNum" :page-size="pageData.pageSize"
                :page-size-opts="pageData.pageOptionsList" style="margin-bottom:15px"
                size="small" @on-change="attachmentPageChange" @on-page-size-change="attachmentPageSizeChange"
                show-elevator
                show-sizer></Page>
        </Row>
      </el-dialog>
      <PdfViewModal ref="pdfViewModal"></PdfViewModal>
    </div>
    <!-- <div v-if="!isShow">
            <InPlanInfo v-if="planStatus == 1" :editItem="editItem" :menuActiveName="menuActiveName" :wareList="wareList" :wmsUrl="wmsUrl" @onIsShow="creteadInfo" @initData="initData" :editItemWarehousing="editItemWarehousing" :editData="editData"></InPlanInfo>
            <OutPlanInfo  v-if="planStatus == 2" :menuActiveName="menuActiveName" :wareList="wareList" :wmsUrl="wmsUrl" @onIsShow="creteadInfo" @initData="initData" :editItemWarehousing="editItemWarehousing" :editItem="editItem" :ccisCustomerCode="ccisCustomerCode"></OutPlanInfo>
            <GoodsTransfer  v-if="planStatus == 3" :menuActiveName="menuActiveName" :wareList="wareList" :wmsUrl="wmsUrl" @onIsShow="creteadInfo" @initData="initData" :list="list" :item="item" :ccisCustomerCode="ccisCustomerCode"></GoodsTransfer> -->
    <!-- <SepPlanInfo  v-if="planStatus == 4" :menuActiveName="menuActiveName" :wareList="wareList" :wmsUrl="wmsUrl" @onIsShow="creteadInfo" @initData="initData" :editItemWarehousing="editItemWarehousing" :editItem="editItem" :orderItem="orderItem"></SepPlanInfo> -->
    <!-- </div> -->
  </div>
</template>

<script>
import {
  getWarehousingList, getExWarehouseList, getColorSeparationList,
  selectApplyDetail, getWarehousingDtail, getCompleteOrderInfo,
  deleteApplyAndApplyDetail, delCcisOutStockApply, submitApply,
  submitApplyC, selectCcisOutStockApplyAndGoodsById, getEditDataByWmsStock, REdoc, customerDownload, selectBoxNumPage,
  selectCustomerInfoByDto, getPage, deleteProp, submitProp, getSepPlanInDtail, getSepPlanInDtailM
} from '@/api/planInfo.js'
import {getAllWareList, queryWarehouseStock} from '@/api/warehouse/home.js';
import baseCodeApi from '@/api/baseCode';
import axios from 'axios';
import InPlanInfo from './inPlanInfo'
import OutPlanInfo from './OutPlanInfo'
import GoodsTransfer from './goodsTransfer'
import SepPlanInfo from './sepPlanInfo';
import fileDownload from 'js-file-download';
import {deleteSepPlanDtails, submitSepPlanDtails, getBusinessprogress} from '@/api/sepPlan'
import PdfViewModal from '@/components/pdfViewModal/pdfViewModal';
import {getFileList} from '@/api/bondedWarehous'
import {getCurrentAgentPermissionWareHouse} from '@/libs/handleWareHouseList';
import EmptyComp from "@/view/wms/comp/EmptyComp.vue";
import {thousandthPercentile} from "../wms/js/index";

export default {
  name: 'index',
  components: {EmptyComp, InPlanInfo, OutPlanInfo, GoodsTransfer, SepPlanInfo, PdfViewModal},
  data() {
    return {
      complete: new Promise((resolve, reject) => {
        this.resolveComplete = resolve;
        this.rejectComplete = reject;
      }),
      // fullscreenLoading: true,
      initialWhId: null,
      orderItem: {},
      tableDataHZList: [],
      sepPlan: '',
      fileType: [],
      orderSelect: [],
      ccisCustomerCodeListFlag: [],
      ccisCustomerCodeListFlagLoading: false,
      searchForm: {
        inPlanOrderStatus: [],
        startArrivedDate: [],
        endRegisterDate: [],
        colorSeparation: [],
        goodsTransfer: [],
        exWarehouse: [],
        expectedDelivery: [],
        searchOrderStatusList: null,
        planOrderNumList: ''
      },
      cancel: '',
      productStatus: {
        '1': '正品',
        '2': '不良品',
        '3': '退货正品',
        '4': '破箱'
      },
      qualityStatus: {
        'F': '合格',
        'U': '不合格'
      },
      goodsBondedPropertyObj: {
        '1': '一般贸易',
        '2': '保税'
      },
      column: [
        {
          key: 'containerNum',
          title: '箱号',
          width: 80
        },
        {
          key: 'carNo',
          title: '车号',
          width: 80
        },
        {
          key: 'displayName',
          title: '文件名称',
          width: 140
        },
        {
          key: 'createdDate',
          title: '创建时间',
          width: 100,
          type: 'date'
        },
        {
          key: 'remark',
          title: '备注',
          width: 140
        },
      ],
      columnTwo: [
        {
          key: 'displayName',
          title: '文件名称',
          width: 140
        },
        {
          key: 'createdDate',
          title: '创建时间',
          width: 100,
          type: 'date'
        },
        {
          key: 'remark',
          title: '备注',
          width: 140
        },
      ],
      dataSelected: [],
      wareSelected: [],
      matSelected: [],
      wareAllChecked: false,
      searchShow: true,
      wareList: [],
      menuActiveName: null,
      tableData: {
        filterList: [],
        pageNum: 1,
        pageSize: 10,
        searchKey: '',
        sortList: [],
        list: [],
        total: 0,
        loading: false,
        pageOptionsList: [10, 20, 30, 40],
        searchOrderStatusList: null
      },
      tableDataTC: {
        filterList: [],
        pageNum: 1,
        pageSize: 10,
        searchKey: '',
        sortList: [],
        list: [],
        total: 0,
        loading: false,
        pageOptionsList: [10, 20, 30, 40]
      },
      wmsUrl: '',
      planStatus: 1,
      editItem: null,
      dialogTableVisible: false,
      dialogTableTitle: '',
      attachmentLoading: false,
      attachmentItem: {
        searchKey: '',
        searchOrderType: null
      },
      selectRowItem: {},
      isShow: true,
      selectionList: [],
      selection: [],
      pageData: {
        loading: false,
        list: [],
        pageNum: 1,
        pageSize: 10,
        total: 0,
        pageOptionsList: [10, 20, 30, 40]
      },
      columnsAddList: [],
      colorSeparationTypeList: [
        {value: '62', label: '入库分色'},
        {value: '61', label: '在库分色'},
        {value: '60', label: '出库分色'}
      ],
      columnsAddListR: [
        {lcatValue: '00', lcatName: '草稿', status: 'draft'},
        {lcatValue: '01', lcatName: '已提交', status: 'draft'},
        {lcatValue: '02', lcatName: '驳回', status: 'draft'},
        {lcatValue: '0,12', lcatName: '未开始', status: 'plan'},
        {lcatValue: '3', lcatName: '进行中', status: 'plan'},
        {lcatValue: '11,6,10,4', lcatName: '已完成', status: 'plan'}
        // {lcatValue:'15',lcatName: '已取消', status: 'plan'},
        // {lcatValue:'16',lcatName: '待确认', status: 'plan'},

        // {lcatValue:'03',lcatName:'申请成功', status: 'draft'},
      ],
      columns: [
        {lcatValue: '0', lcatName: '已创建'},
        {lcatValue: '10', lcatName: '异常完结'},
        {lcatValue: '11', lcatName: '作业异常'},
        {lcatValue: '3', lcatName: '开始作业'},
        {lcatValue: '4', lcatName: '作业完成'},
        {lcatValue: '12', lcatName: '到货登记'},
        {lcatValue: '6', lcatName: '入库完成'},
        // {lcatValue:'15',lcatName: '已取消'},
        // {lcatValue:'16',lcatName: '待确认'},
      ],
      columnNew: [
        {lcatValue: '0', lcatName: '草稿', status: 'draft'},
        {lcatValue: '1', lcatName: '已提交', status: 'draft'},
        {lcatValue: '2', lcatName: '驳回', status: 'draft'},
        {lcatValue: '3', lcatName: '申请成功', status: 'draft'},
      ],
      columnsTwoS: [
        {lcatValue: '0', lcatName: '草稿'},
        {lcatValue: '1', lcatName: '已提交'},
        {lcatValue: '3', lcatName: '驳回'},
        {lcatValue: '00,11,05', lcatName: '未开始'},
        {lcatValue: '22,33', lcatName: '进行中'},
        {lcatValue: '44,45,41,40', lcatName: '已完成'},

      ],
      columnsInPlanNB: [
        {lcatValue: '11', lcatName: '已完成'},
        {lcatValue: '3', lcatName: '进行中'},
        {lcatValue: '12', lcatName: '未开始'},
        {lcatValue: '2', lcatName: '驳回'},
        {lcatValue: '1', lcatName: '已提交'},
        {lcatValue: '0', lcatName: '草稿'}
      ],
      columnsNB: [
        {lcatValue: '55', lcatName: '已关单'},
        {lcatValue: '44', lcatName: '发货完成'},
        {lcatValue: '33', lcatName: '部分完成'},
        {lcatValue: '22', lcatName: '发货中'},
        {lcatValue: '11', lcatName: '提货登记'},
        {lcatValue: '00', lcatName: '已创建'},
        {lcatValue: '-1', lcatName: '草稿'},
        {lcatValue: '0', lcatName: '已提交'},
        {lcatValue: '1', lcatName: '审批通过'},
        {lcatValue: '2', lcatName: '驳回'},
        {lcatValue: '3', lcatName: '取消'},
        {lcatValue: '4', lcatName: '草稿'}
      ],
      columnsTwo: [
        {lcatValue: '66', lcatName: '备货完成'},
        {lcatValue: '45', lcatName: '异常完结'},
        {lcatValue: '55', lcatName: '备货中'},
        {lcatValue: '54', lcatName: '异常完结中'},
        {lcatValue: '45', lcatName: '异常完结'},
        {lcatValue: '44', lcatName: '出库完成'},
        {lcatValue: '33', lcatName: '部分拣货'},
        {lcatValue: '22', lcatName: '移动下架'},
        {lcatValue: '11', lcatName: '等待出库'},
        {lcatValue: '00', lcatName: '已创建'},
        {lcatValue: '0', lcatName: '草稿'},
        {lcatValue: '1', lcatName: '已提交'},
        {lcatValue: '2', lcatName: '审批通过'},
        {lcatValue: '3', lcatName: '驳回'},
        {lcatValue: '40', lcatName: '作业完成'},
        {lcatValue: '41', lcatName: '作业异常'},
        {lcatValue: '05', lcatName: '已审批'}
      ],
      columnsS: [
        {lcatValue: '0', lcatName: '草稿'},
        {lcatValue: '2', lcatName: '已提交'},
        {lcatValue: '5', lcatName: '驳回'},
        {lcatValue: '3', lcatName: '货转中'},
        {lcatValue: '4', lcatName: '货转完成'},
        {lcatValue: '6', lcatName: '已受理'}
      ],
      columnsFS: [
        // {lcatValue:'20',lcatName:'执行中'},
        {lcatValue: '0', lcatName: '草稿'},
        {lcatValue: '1', lcatName: '已提交'},
        {lcatValue: '2', lcatName: '驳回'},
        {lcatValue: '10', lcatName: '未开始'},
        {lcatValue: '13,30,20', lcatName: '进行中'},
        {lcatValue: '40,55,45', lcatName: '已完成'},
      ],
      columnsF: [
        {lcatValue: '20', lcatName: '执行中'},
        {lcatValue: '40', lcatName: '已完成'},
        {lcatValue: '30', lcatName: '部分完成'},
        {lcatValue: '10', lcatName: '已创建'},
        {lcatValue: '13', lcatName: '已排台'},
        {lcatValue: '45', lcatName: '异常完结'},
        {lcatValue: '55', lcatName: '异常完结'},
        {lcatValue: '0', lcatName: '草稿'},
        {lcatValue: '1', lcatName: '已提交'},
        {lcatValue: '2', lcatName: '驳回'},
        {lcatValue: '3', lcatName: '申请成功'}
      ],
      activeRow: {},
      completeOrderInfo: {},
      completeOrderInfoH: [],
      runningNumR: null,
      source: null,
      boxNumR: null,
      WeightR: null,
      runningNumC: null,
      boxNumC: null,
      WeightC: null,
      runningNumH: null,
      boxNumH: null,
      WeightH: null,
      runningNumF: null,
      boxNumF: null,
      WeightF: null,
      qtyH: null,
      qtyF: null,
      editItemWarehousing: null,
      ccisCustomerCode: '',
      list: [],
      item: null,
      statusName: '',
      applyType: 'in',
      editData: {}
    };
  },
  computed: {
    totalWeight() {
      return this.dataSelected.reduce((sum, item) => {
        return sum + Number((item.orderWeight / 1000).toFixed(3));
      }, 0);
    },
    belongUserCustomerList() {
      return window.localStorage.getItem('belongUserCustomerList') ? JSON.parse(window.localStorage.getItem('belongUserCustomerList')) : [];
    },
    agentPermission() {
      return function (val) {
        if (this.belongUserCustomerList.length && this.belongUserCustomerList.some(item => item.customerName == val)) {
          return 'Y'
        } else {
          return 'N'
        }
      }
    }
  },
  methods: {
    thousandthPercentile,
    resolveComplete() {
    },
    rejectComplete() {
    },

    lookFile(row) {
      let suffix = row.fileName.split('.')[1].toLowerCase();
      if (suffix != 'pdf' && suffix != 'png' && suffix != 'jpg' && suffix != 'jpeg') {
        this.$message.warning('不能预览非PDF、png、jpg、jpeg格式的文件');
        return;
      }
      this.$refs.pdfViewModal.loadFile(row, this.menuActiveName);
    },
    getLocalTime(n) {
      return new Date(parseInt(n)).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
    },
    statusChange(items) {
      this.columnsAddList.some((item) => {
        items.forEach(itemTs => {
          if (item.lcatValue == itemTs) {
            this.statusName = item.status
            return true;
          }
        })
      })
    },
    computedBusinessName(row, prop) {
      console.log(row)
      if (row) {
        if (row.completeProportion) {
          return prop + '-' + row.completeProportion
        } else {
          return prop
        }
      } else {
        return prop
      }
    },
    computedBusiness(row) {
      if (row) {
        if (row.date) {
          if (row.createName) {
            return row.date + '-' + row.createName
          } else {
            return row.date
          }
        } else {
          if (row.createName) {
            return row.createName
          } else {
            return ''
          }
        }
      }
    },
    inPlanInfoD(item, type) {
      let obj = {businessType: type, orderNum: type === 'in' ? item.orderNum : item.outPlanOrderNum}
      if (type == 'pop') {
        obj.orderNum = item.changeOrderNum
        obj.item = item.item
      }
      getBusinessprogress(obj, this.wmsUrl).then(res => {
        res.data.returnData.forEach(keys => {
          if (keys.registerDate) {
            keys.date = this.getLocalTime(keys.registerDate).slice(0, -3)
          }
          if (keys.createTime) {
            keys.date = this.getLocalTime(keys.createTime).slice(0, -3)
          }
          if (keys.entryTime) {
            keys.date = this.getLocalTime(keys.entryTime).slice(0, -3)
          }
          if (keys.lastModifiedTime) {
            keys.date = this.getLocalTime(keys.lastModifiedTime).slice(0, -3)
          }
          if (keys.deliveryTime) {
            keys.date = this.getLocalTime(keys.deliveryTime).slice(0, -3)
          }
          if (keys.createName) {
            keys.createName = keys.createName;
          }
          if (keys.operatorName) {
            keys.createName = keys.operatorName
          }
          if (keys.userName) {
            keys.createName = keys.userName;
          }
        })
        item.BusiList = res.data.returnData
        item.dtailInfo = !item.dtailInfo;
      })
    },
    EditInfoFs(item) {
      window.localStorage.setItem('EditInfocode', '200')
      this.orderItem = item
      if (this.planStatus == 4) {
        this.$router.push({
          name: 'sepPlanInfo',
          query: {
            menuActiveName: JSON.stringify(this.menuActiveName),
            wareList: JSON.stringify(this.wareList),
            wmsUrl: JSON.stringify(this.wmsUrl),
            editItemWarehousing: JSON.stringify(this.editItemWarehousing),
            editItem: JSON.stringify(this.editItem),
            orderItem: JSON.stringify(this.orderItem)
          }
        })
        return
      }
      this.isShow = !this.isShow
    },
    deleteSepPlanDtailsFs(item) {

      this.$Modal.confirm({
        title: '提示',
        content: '确认进行删除操作',
        onOk: () => {
          deleteSepPlanDtails([{orderNum: item.orderNum}], this.wmsUrl).then(({data}) => {
            if (data.returnCode === 200) {
              this.$Message.success('操作成功')
              this.initData();
            } else {
              this.$Message.error(data.returnMsg)
            }
          })
        },
        onCancel: () => {
        }
      })
    },
    submitSepPlanDtailsFs(item) {
      submitSepPlanDtails({orderNum: item.orderNum}, this.wmsUrl).then(res => {
        if (res.data.returnCode == 200) {
          this.initData()
        }
      })
    },
    EditInfoHZ(item) {
      window.localStorage.setItem('EditInfocode', '200')
      this.item = item,
        this.list = item.list
      this.$router.push({
        name: 'goodsTransfer',
        query: {
          menuActiveName: JSON.stringify(this.menuActiveName),
          wareList: JSON.stringify(this.wareList),
          wmsUrl: JSON.stringify(this.wmsUrl),
          item: JSON.stringify(this.item),
          list: JSON.stringify(this.list),
          ccisCustomerCode: JSON.stringify(this.ccisCustomerCode),
        }
      })
      return
      // this.isShow = !this.isShow
    },
    submitApplyHZ(item) {
      let body = item.changeOrderNum
      submitProp(body, this.wmsUrl).then(({data}) => {
        if (data.returnCode == 200) {
          this.$Message.success('操作成功');
          this.initData();
        }
      })
    },
    delCcisOutStoHZApply(item) {
      let body = item.changeOrderNum
      deleteProp(body, this.wmsUrl).then(({data}) => {
        if (data.returnCode == 200) {
          this.$Message.success('操作成功');
          this.initData();
        }
      })
    },
    selectCustomerInfoByDto() {
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      selectCustomerInfoByDto({'ccisCustomerCode': this.$utils.getUserInfo().entrustingPartyCode}, this.wmsUrl, aCancelToken).then(({data}) => {
        if (data.returnCode == 200) {
          this.ccisCustomerCode = data.returnData[0].customerCode
        }
      })
    },
    EditInfoCK(item) {
      window.localStorage.setItem('EditInfocode', '200')
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      if (this.activeRow.id === null) {
        getEditDataByWmsStock({'outPlanOrderNum': item.outPlanOrderNum}, this.wmsUrl, aCancelToken).then(({data}) => {
          if (data.returnCode === 200) {
            this.$set(this.activeRow, 'warehousing', data.returnData.wmsStockDTOList)
            this.$router.push({
              name: 'OutPlanInfo',
              query: {
                menuActiveName: JSON.stringify(this.menuActiveName),
                wareList: JSON.stringify(this.wareList),
                wmsUrl: JSON.stringify(this.wmsUrl),
                editItemWarehousing: JSON.stringify(this.editItemWarehousing),
                editItem: JSON.stringify(this.editItem),
                ccisCustomerCode: JSON.stringify(this.ccisCustomerCode)
              }
            })
          }
        });
      } else {
        selectCcisOutStockApplyAndGoodsById(item.id, this.wmsUrl, aCancelToken).then(({data}) => {
          if (data.returnCode === 200) {
            this.$set(this.activeRow, 'warehousing', data.returnData.wmsStockDTOList)
            this.$set(item, 'fileList', data.returnData.wmsOutPlanDTO.fileList)
            this.editItem = item;
            this.editItemWarehousing = item.warehousing
            console.log(232323,this.ccisCustomerCode);
            this.$router.push({
              name: 'OutPlanInfo',
              query: {
                menuActiveName: JSON.stringify(this.menuActiveName),
                wareList: JSON.stringify(this.wareList),
                wmsUrl: JSON.stringify(this.wmsUrl),
                editItemWarehousing: JSON.stringify(this.editItemWarehousing),
                editItem: JSON.stringify(this.editItem),
                ccisCustomerCode: JSON.stringify(this.ccisCustomerCode),
                editStatus: JSON.stringify('create'),
                escort: JSON.stringify(data.returnData.wmsOutPlanDTO.escort)
              }
            })
          }
        });
      }
    },
    submitApplyCK(item) {
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      this.$Modal.confirm({
        title: '提示',
        content: '确认进行提交操作',
        onOk: () => {
          let body = {id: item.id}
          submitApplyC(body, this.wmsUrl, aCancelToken).then(({data}) => {
            if (data.returnCode === 200) {
              this.$Message.success('操作成功')
              this.initData();
            } else {
              this.$Message.error(data.returnMsg)
            }
          });
        },
        onCancel: () => {
        }
      });
    },
    delCcisOutStockApply(item) {
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      this.$Modal.confirm({
        title: '提示',
        content: '确认进行删除操作',
        onOk: () => {
          let body = [item.id]
          delCcisOutStockApply(body, this.wmsUrl, aCancelToken).then(({data}) => {
            if (data.returnCode === 200) {
              this.$Message.success('操作成功')
              this.initData();
            } else {
              this.$Message.error(data.returnMsg)
            }
          });
        },
        onCancel: () => {
        }
      })
    },
    delectInfo(item) {
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      this.$Modal.confirm({
        title: '提示',
        content: '确认进行删除操作',
        onOk: () => {
          let body = [item.id]
          deleteApplyAndApplyDetail(body, this.wmsUrl, aCancelToken).then(({data}) => {
            if (data.returnCode === 200) {
              this.$Message.success('操作成功')
              this.initData();
            } else {
              this.$Message.error(data.returnMsg)
            }
          });
        },
        onCancel: () => {
        }
      })
    },
    EditInfo(item) {
      window.localStorage.setItem('EditInfocode', '200')
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      selectApplyDetail({id: item.id}, this.wmsUrl, aCancelToken).then(({data}) => {
        if (data.returnCode == 200) {
          this.$nextTick(() => {
            this.editData = data;
            this.editItemWarehousing = data.returnData.list
            this.$set(item, 'warehousing', data.returnData.list)
            this.$set(item, 'fileList', data.returnData.fileList)
            item['remark'] = data.returnData.remark
            this.editItem = item;
            // this.isShow = !this.isShow
            this.$router.push({
              name: 'inPlanInfo',
              query: {
                menuActiveName: JSON.stringify(this.menuActiveName),
                wareList: JSON.stringify(this.wareList),
                wmsUrl: JSON.stringify(this.wmsUrl),
                editItemWarehousing: JSON.stringify(this.editItemWarehousing),
                editItem: JSON.stringify(this.editItem),
                editData: JSON.stringify(this.editData),
                editStatus: JSON.stringify('create')
              }
            })
            return
          })
        }
      })
      // this.editItemWarehousing = item.warehousing
    },
    getDictData() {
      // 字典
      baseCodeApi.getDictDataByDictTypeList([
        'FLIE_TYPE',
      ]).then(({data}) => {
        if (data.returnCode === 200) {
          const {returnData} = data;
          // dataInfo.menuList = data.returnData.filter(item => item.dictType === 'CONTRACT_STATUS');
          this.fileType = returnData.filter(item => item.dictType === 'FLIE_TYPE');
        } else {
          this.$Message.error(data.returnMsg);
        }
      }).catch(err => {
        console.log(err);
      });
    },
    submitInfo(item) {
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      this.$Modal.confirm({
        title: '提示',
        content: '确认进行提交操作',
        onOk: () => {
          let body = {id: item.id}
          submitApply(body, this.wmsUrl, aCancelToken).then(({data}) => {
            if (data.returnCode === 200) {
              this.$Message.success('操作成功')
              this.initData();
            } else {
              this.$Message.error(data.returnMsg)
            }
          });
        },
        onCancel: () => {
        }
      })
    },
    radioChange(e, item) {
      console.log(e, item)
      this.$nextTick(() => {
        item.orderSelect = e;
        item.orderSelect = item.orderSelect
      })
    },
    async downloadFile() {
      if (!this.selection || this.selection.length === 0) {
        this.$Message.warning('请选择一条信息操作')
        return;
      }
      this.attachmentLoading = true;
      let sum = 0;
      for (const item of this.selection) {
        let body = {
          "id": item.id,
          "customerCode": null,
          "businessNum": item.businessNum,
          "businessType": null,
          "fileName": item.fileName,
          "fileUrl": item.fileUrl,
          "remark": null,
          "createdBy": null,
          "createdDate": item.createdDate,
          "lastModifiedBy": null,
          "lastModifiedTime": null,
          "deleteFlag": 0,
          "fileSource": "F",
          "businessItem": null,
          "fileType": "null",
          "fileTypeList": null,
          "minioObjectName": null,
          "displayName": item.displayName,
          "fileSuffix": "pdf",
          "fileSuffixEdit": "pdf",
          "shortFileName": ''
        }
        const data = await customerDownload(body, this.wmsUrl)
        if (data.status === 200) {
          sum++;
          fileDownload(data.data, 'EDOC' + body.fileName.split(',')[0].toLowerCase())
        }
      }
      if (sum === this.selection.length) {
        this.attachmentLoading = false;
        this.$Message.success('操作成功')
      }
    },
    viewDetails(item, type) {
      // let body = {
      //     pageNum: 1,
      //     pageSize: 999,
      //     filterList: [],
      //     pageOptionsList: [50, 100, 200],
      //     sortList: [],
      //     searchKey: item.orderNum
      // }
      if (item.dtailInfo) {
        item.dtailInfo = false
        return
      }
      let body = {orderNum: item.outPlanOrderNum, businessType: type}
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      if (this.planStatus == '4' || this.planStatus == '2') {
        if (this.$menuActiveName == 26 || this.$menuActiveName == 37) {
          getSepPlanInDtail(body, this.wmsUrl, aCancelToken).then(({data}) => {
            if (data.returnCode === 200) {
              let dataPageInfoList = data.returnData
              if (dataPageInfoList.length == 0) {
                this.$message({
                  message: '当前订单无分色数据',
                  type: 'error'
                });
                return
              }
              item['dataPageInfoList'] = dataPageInfoList;
              getSepPlanInDtailM(body, this.wmsUrl, aCancelToken).then(({data}) => {
                this.$set(item['dataPageInfoList'][0], 'separationOrderChildList', data.returnData)
                // item.dtailInfo = true;
                getBusinessprogress(obj, this.wmsUrl).then(res => {
                  res.data.returnData.forEach(keys => {
                    if (keys.registerDate) {
                      keys.date = this.getLocalTime(keys.registerDate).slice(0, -3)
                    }
                    if (keys.createTime) {
                      keys.date = this.getLocalTime(keys.createTime).slice(0, -3)
                    }
                    if (keys.entryTime) {
                      keys.date = this.getLocalTime(keys.entryTime).slice(0, -3)
                    }
                    if (keys.lastModifiedTime) {
                      keys.date = this.getLocalTime(keys.lastModifiedTime).slice(0, -3)
                    }
                    if (keys.deliveryTime) {
                      keys.date = this.getLocalTime(keys.deliveryTime).slice(0, -3)
                    }
                    if (keys.createName) {
                      keys.createName = keys.createName;
                    }
                    if (keys.operatorName) {
                      keys.createName = keys.operatorName
                    }
                    if (keys.userName) {
                      keys.createName = keys.userName;
                    }
                  })
                  item.BusiList = res.data.returnData
                  if (this.planStatus == '4') {
                    item.dtailInfo = true;
                  }
                })
              })
            }
          });
        } else {
          getSepPlanInDtail(body, this.wmsUrl, aCancelToken).then(({data}) => {
            if (data.returnCode === 200) {
              let dataPageInfoList = data.returnData
              if (dataPageInfoList.length == 0) {
                this.$message({
                  message: '当前订单无分色数据',
                  type: 'error'
                });
                return
              }
              item['dataPageInfoList'] = dataPageInfoList;
              getSepPlanInDtailM(body, this.wmsUrl, aCancelToken).then(({data}) => {
                this.$set(item['dataPageInfoList'][0], 'separationOrderChildList', data.returnData)
                // item.dtailInfo = true;
                getBusinessprogress(obj, this.wmsUrl).then(res => {
                  console.log(res, 'resssssssssssssssssss')
                  res.data.returnData.forEach(keys => {
                    if (keys.registerDate) {
                      keys.date = this.getLocalTime(keys.registerDate).slice(0, -3)
                    }
                    if (keys.createTime) {
                      keys.date = this.getLocalTime(keys.createTime).slice(0, -3)
                    }
                    if (keys.entryTime) {
                      keys.date = this.getLocalTime(keys.entryTime).slice(0, -3)
                    }
                    if (keys.lastModifiedTime) {
                      keys.date = this.getLocalTime(keys.lastModifiedTime).slice(0, -3)
                    }
                    if (keys.deliveryTime) {
                      keys.date = this.getLocalTime(keys.deliveryTime).slice(0, -3)
                    }
                    if (keys.createName) {
                      keys.createName = keys.createName;
                    }
                    if (keys.operatorName) {
                      keys.createName = keys.operatorName
                    }
                    if (keys.userName) {
                      keys.createName = keys.userName;
                    }
                  })
                  item.BusiList = res.data.returnData
                  if (this.planStatus == '4') {
                    item.dtailInfo = true;
                  }
                })
              })
            }
          });
        }
      }
      // this.inPlanInfoD(item)
      if (this.planStatus == '2') {
        item.dtailInfo = !item.dtailInfo;
      }
      let obj = {businessType: type, orderNum: item.orderNum}
      if (type == 'out') {
        obj.orderNum = item.outPlanOrderNum
        getBusinessprogress(obj, this.wmsUrl).then(res => {
          res.data.returnData.forEach(keys => {
            if (keys.registerDate) {
              keys.date = this.getLocalTime(keys.registerDate).slice(0, -3)
            }
            if (keys.createTime) {
              keys.date = this.getLocalTime(keys.createTime).slice(0, -3)
            }
            if (keys.entryTime) {
              keys.date = this.getLocalTime(keys.entryTime).slice(0, -3)
            }
            if (keys.lastModifiedTime) {
              keys.date = this.getLocalTime(keys.lastModifiedTime).slice(0, -3)
            }
            if (keys.deliveryTime) {
              keys.date = this.getLocalTime(keys.deliveryTime).slice(0, -3)
            }
            if (keys.createName) {
              keys.createName = keys.createName;
            }
            if (keys.operatorName) {
              keys.createName = keys.operatorName
            }
            if (keys.userName) {
              keys.createName = keys.userName;
            }
          })
          item.BusiList = res.data.returnData
          if (this.planStatus == '4') {
            item.dtailInfo = true;
          }
        })
      }

    },
    activeInfo(row) {
      // console.log(row.dtailInfo);
      // if(this.activeRow.inPlanOrderNum == row.inPlanOrderNum && this.planStatus == 1){
      //     this.activeRow = {}
      // }else if(this.activeRow.outPlanOrderNum == row.outPlanOrderNum && this.planStatus == 2){
      //     this.activeRow = {}
      // }else if(this.activeRow.orderNum == row.orderNum && this.planStatus == 3){
      //     this.activeRow = {}
      // }else if(this.activeRow.orderNum == row.orderNum && this.planStatus == 4){
      //     this.activeRow = {}
      // }else{
      this.activeRow = row;
      this.tableData.list.some((item, index) => {
        if (item.orderNum === this.activeRow.orderNum) {
          this.selectIndex = index;
          return true;
        }
      })
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      // delete this.activeRow.warehousing
      if (this.planStatus == 2) {
        if (!this.activeRow.warehousing) {
          if (this.activeRow.id === null) {
            getEditDataByWmsStock({'outPlanOrderNum': this.activeRow.outPlanOrderNum}, this.wmsUrl, aCancelToken).then(({data}) => {
              if (data.returnCode === 200) {
                this.$set(this.activeRow, 'warehousing', data.returnData)
              }
            });
          } else {
            selectCcisOutStockApplyAndGoodsById(this.activeRow.id, this.wmsUrl, aCancelToken).then(({data}) => {
              if (data.returnCode === 200) {
                this.$set(this.activeRow, 'warehousing', data.returnData.wmsStockDTOList)
              }
            });
          }
        }
      } else if (this.planStatus == 1) {
        if (row.id === null) {
          getWarehousingDtail({inPlanOrderNum: row.orderNum}, this.wmsUrl, aCancelToken).then(({data}) => {
            this.editItemWarehousing = data.returnData.list
            this.$set(row, 'warehousing', data.returnData)
          })
        } else {
          selectApplyDetail({id: row.id}, this.wmsUrl, aCancelToken).then(({data}) => {
            this.editItemWarehousing = data.returnData.list
            this.editItemWarehousing.forEach(item => {
              let d = new Date(item.dateGen);
              d.setMonth(d.getMonth() + parseInt(item.validatePeriod));
              let dateExpire = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
              item.dateExpire = dateExpire;
            })
            this.$set(row, 'warehousing', data.returnData.list)
            row['remark'] = data.returnData.remark
          })
        }
      }
    },
    search() {
      this.initData();
    },
    searchRest() {
      this.searchForm = {
        inPlanOrderStatus: [],
        startArrivedDate: [],
        endRegisterDate: []
      }
      this.search();
    },
    selectBoxNumPage(wmsUrl, id, checked) {
      if (this.$route.params.planOrderNumList) {
        this.searchForm.planOrderNumList = this.$route.params.planOrderNumList
      }
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      let body
      if (this.searchForm.planOrderNumList) {
        body = {
          ...this.getOwnerParams(),
          pageNum: 1,
          pageSize: 10,
          searchKey: this.tableData.searchKey,
          planOrderNumList: this.searchForm.planOrderNumList,
          sortList: [],
          searchOrderType: "",
          searchOrderTypeList: [],
          searchOrderStatusList: [],
          notInMatTypeCodeList: [
            "9999",
            "0001"
          ],
          applyType: this.applyType
        }
      } else {
        body = {
          ...this.getOwnerParams(),
          pageNum: 1,
          pageSize: 10,
          searchKey: this.tableData.searchKey,
          sortList: [],
          searchOrderType: "",
          searchOrderTypeList: [],
          searchOrderStatusList: [],
          notInMatTypeCodeList: [
            "9999",
            "0001"
          ],
          applyType: this.applyType
        }
      }
      if (this.completeOrderInfoH.length == 0) {
        selectBoxNumPage(body, wmsUrl, aCancelToken).then(({data}) => {
          if (this.$route.params.planOrderNumList != undefined) {
            if (this.$route.params.planOrderNumList.length > 0) {
              this.$route.params.planOrderNumList = [];
            }
          }
          this.wareList.forEach(item => {
            if (this.completeOrderInfoH.length != this.wareList.filter(item => item.checked).length) {
              this.completeOrderInfoH.push('')
            }
          })
          this.wareList.forEach((item, index) => {
            if (id == item.id && data.returnCode === 200) {
              if (data.returnCode !== 200) {
                this.completeOrderInfoH[index] = this.planStatus != 3 ? 0 : '0柜/0货品';
              } else {
                if (this.planStatus != 3) {
                  this.completeOrderInfoH[index] = data.returnData.boxNum;
                } else {
                  this.completeOrderInfoH[index] = data.returnData.containerNumCount + '柜/' + data.returnData.boxNum + '货品'
                }
              }
            }
          })
          if (this.completeOrderInfoH.length >= 3) {
            if (this.completeOrderInfoH[0].boxNum != '' && this.completeOrderInfoH[1].boxNum != '' && this.completeOrderInfoH[2].boxNum != '') {
              this.completeOrderInfoH = this.completeOrderInfoH
            }
          }
        })
      }
    },
    getAllWare() {
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      getCurrentAgentPermissionWareHouse().then(({data: returnData, message, error}) => {
        if (returnData) {
          returnData.forEach(x => {
            this.$nextTick(() => {
              this.selectBoxNumPage(x.ipProt, x.id, x.checked)
            })
            x.checked = true;
            x.whId = x.id;
          });
          this.wareList = returnData;
          const {currentAgentPermission, customerInfoList, entrustingPartyCode} = this.$utils.getUserInfo();
          const params = currentAgentPermission ? {ccisCustomerCodeList: customerInfoList.map(i => i.customerPartyCode)} : {ccisCustomerCode: entrustingPartyCode};
          let res = [];
          this.wareList.forEach(item => {
            res.push(selectCustomerInfoByDto(params, item.ipProt, aCancelToken))
          });

          new Promise(resolve => {
            Promise.all(res).then(r => {
              if (r.some(i => !i.data)) resolve();
              for (const index in r) {
                if (r[index].data.returnCode === 200) {
                  this.$set(this.wareList[index], 'ccisCustomerCodeList', r[index].data.returnData);
                }
              }
              resolve();
            }).catch(error => {
              console.log(error);
              resolve();
            })
          }).then(() => {
            this.ccisCustomerCodeListFlag = this.wareList.filter(item => {
              return item.ccisCustomerCodeList && item.ccisCustomerCodeList.length > 0
            })
            this.ccisCustomerCodeListFlagLoading = false;
          });
          getCompleteOrderInfo(this.wareList.filter(item => item.checked).map(x => x.whId)).then(res => {
            if (res.data.returnCode == 200) {
              if (this.$route.params.whIdList) {
                this.initData();
              }
              this.completeOrderInfo = res.data.returnData
              this.wareList.forEach((item, index) => {
                if (this.completeOrderInfo[index] !== undefined) {
                  item.completeInfo = this.completeOrderInfo[index]
                  if (item.completeInfo.colorSeparation !== null && item.completeInfo.goodsTransfer !== null && item.completeInfo.inPlan !== null && item.completeInfo.outPlan !== null) {
                    item.boxNum = item.completeInfo.colorSeparation.boxNum * 1 + item.completeInfo.goodsTransfer.boxNum * 1 + item.completeInfo.inPlan.boxNum * 1 + item.completeInfo.outPlan.boxNum * 1
                    item.weight = (((item.completeInfo.colorSeparation.weight / 1000).toFixed(3) * 1 + (item.completeInfo.goodsTransfer.weight / 1000).toFixed(3) * 1 + (item.completeInfo.inPlan.weight / 1000).toFixed(3) * 1 + (item.completeInfo.outPlan.weight / 1000).toFixed(3) * 1)).toFixed(3)
                  } else {
                    item.boxNum = 0;
                    item.weight = 0;
                  }
                } else {
                  item.boxNum = 0;
                  item.weight = 0;
                }
              })
            }
            this.wareList.forEach((item, index) => {
              if (item.weight == undefined || item.boxNum == undefined) {
                this.wareList = this.wareList;
              }
            });
            this.wmsUrl = returnData[0].ipProt;
            this.initWareList(returnData);
            this.menuActiveName = returnData[0].id;
            this.init();
          })
          if (this.$route.params.planStatus) {
            this.creteadInfo()
          }
          this.fullscreenLoading = false;
        } else {
          // this.fullscreenLoading = false;
          this.$Message.error(message || error);
        }
      });
    },
    wareClick(item) {
      this.tableData.searchOrderStatusList = [];
      this.tableData.filterList = [];
      this.searchForm = {
        ownerCodeList: this.getOwnerCodeListDefault(),
        inPlanOrderStatus: [],
        startArrivedDate: [],
        endRegisterDate: [],
        colorSeparation: [],
        goodsTransfer: [],
        exWarehouse: [],
        expectedDelivery: [],
        searchOrderStatusList: null,
        planOrderNumList: ''
      };
      this.tableData.searchKey = '';
      item.checked = !item.checked;
      // if(this.wareList.filter(item => item.checked).length == 0){
      //     this.planStatus = 0
      //     // this.menuActiveName = item.id*1
      // }else{
      this.menuActiveName = item.id * 1
      this.$nextTick(() => {
        this.planStatus = 1
        this.applyType = 'in'
      })
      // }
      this.$nextTick(() => {
        this.completeOrderInfoH = [];
        this.wareList.forEach((x) => {
          if (x.checked) {
            this.selectBoxNumPage(x.ipProt, x.id, x.checked)
          }
        })
        console.log(this.wareList);
        this.completeOrderInfoH = this.completeOrderInfoH
        // if (this.completeOrderInfoH[0] == '') {
        //     this.initData()
        // }
      })
    },
    matClick(item) {
      if (this.$route.params.menuActiveName == 27) {
        this.menuActiveName = 26;
        this.$route.params.menuActiveName = ''
      }
      this.tableData.pageNum = 1
      this.tableData.searchOrderStatusList = [];
      this.tableData.filterList = [];
      // this.tableData.searchKey = '';
      if (this.planStatus != item) {
        this.planStatus = item
        this.searchForm = {
          ownerCodeList: this.getOwnerCodeListDefault(),
          inPlanOrderStatus: null,
          startArrivedDate: [],
          endRegisterDate: [],
          colorSeparation: [],
          goodsTransfer: [],
          exWarehouse: [],
          expectedDelivery: [],
          searchOrderStatusList: null,
          planOrderNumList: ''
        }
        this.initData();
      }
      if (item == 1) {
        this.columnsAddList = this.columnsAddListR
        this.applyType = 'in'
      } else if (item == 2) {
        this.columnsAddList = this.columnsTwoS
        this.applyType = 'out'
      } else if (item == 3) {
        this.columnsAddList = this.columnsS
        this.applyType = 'prop'
      } else if (item == 4) {
        this.columnsAddList = this.columnsFS
        this.applyType = 'sep'
      }
      this.completeOrderInfoH = [];
      this.wareList.forEach((x) => {
        this.selectBoxNumPage(x.ipProt, x.id, x.checked)
      })
      console.log(23423423423, this.wareList)
      // this.$nextTick(() => {
      // this.searchForm.inPlanOrderStatus = '';
      //     console.log(this.searchForm.inPlanOrderStatus);
      // })
      let wareListAll = setInterval(() => {
        if (this.wareList.length > 0) {
          // this.initData();
          clearInterval(wareListAll)
        }
      }, 300)
      setTimeout(() => {
        this.menuSelect(this.menuActiveName);
      }, 2000)
    },
    wareAllCheck() {
      this.wareAllChecked = !this.wareAllChecked;
      this.wareList.forEach(x => {
        x.checked = this.wareAllChecked;
      });
      if (this.wareList.filter(item => item.checked).length == 0) {
        this.planStatus = 1
        this.applyType = 'in'
      } else {
        this.planStatus = 1
        this.menuActiveName = this.wareList[0].id * 1
        this.applyType = 'in'
      }
      this.completeOrderInfoH = []
      this.$nextTick(() => {
        this.wareList.forEach((x) => {
          if (x.checked) {
            this.selectBoxNumPage(x.ipProt, x.id, x.checked)
          }
        })
        this.completeOrderInfoH = this.completeOrderInfoH
        this.tableData.searchOrderStatusList = [];
        this.tableData.filterList = [];
        this.searchForm = {
          ownerCodeList: this.getOwnerCodeListDefault(),
          inPlanOrderStatus: [],
          startArrivedDate: [],
          endRegisterDate: [],
          colorSeparation: [],
          goodsTransfer: [],
          exWarehouse: [],
          expectedDelivery: [],
          searchOrderStatusList: null,
          planOrderNumList: ''
        };
        this.tableData.searchKey = '';
      })
    },
    reset() {
      this.tableData.searchOrderStatusList = [];
      this.tableData.filterList = [];
      this.searchForm = {
        ownerCodeList: this.getOwnerCodeListDefault(),
        inPlanOrderStatus: [],
        startArrivedDate: [],
        endRegisterDate: [],
        colorSeparation: [],
        goodsTransfer: [],
        exWarehouse: [],
        expectedDelivery: [],
        searchOrderStatusList: null,
        planOrderNumList: ''
      };
      this.tableData.searchKey = '';
      this.initData();
    },
    searchKeyInfo() {
      // this.searchForm = {
      //     inPlanOrderStatus:null,
      //     startArrivedDate:[],
      //     endRegisterDate:[],
      //     colorSeparation:[],
      //     goodsTransfer:[],
      //     exWarehouse:[],
      //     expectedDelivery:[]
      // }
      this.tableData.searchOrderStatusList = [];
      this.tableData.filterList = [];
      if (this.searchForm.validatePeriod) {
        this.tableData.filterList.push({
          filterKey: 'validatePeriod',
          filterValue: this.searchForm.validatePeriod
        });
      }
      if (this.searchForm.supervisionStatus) {
        this.tableData.filterList.push({
          filterKey: 'supervisionStatus',
          filterValue: this.searchForm.supervisionStatus
        });
      }
      if (this.searchForm.productStatus) {
        this.tableData.filterList.push({
          filterKey: 'productStatus',
          filterValue: this.searchForm.productStatus
        });
      }
      if (this.searchForm.qualityStatus) {
        this.tableData.filterList.push({
          filterKey: 'qualityStatus',
          filterValue: this.searchForm.qualityStatus
        });
      }
      if (this.searchForm.dateInto && this.searchForm.dateInto.length > 0) {
        this.tableData.filterList.push({
          filterKey: 'dateIntoStartDate',
          filterValue: this.$utils.dateToDateStr(this.searchForm.dateInto[0])
        });
        this.tableData.filterList.push({
          filterKey: 'dateIntoEndDate',
          filterValue: this.$utils.dateToDateStr(this.searchForm.dateInto[1])
        });
      }
      if (this.searchForm.dateGen && this.searchForm.dateGen.length > 0) {
        this.tableData.filterList.push({
          filterKey: 'dateGenStart',
          filterValue: this.$utils.dateToDateStr(this.searchForm.dateGen[0])
        });
        this.tableData.filterList.push({
          filterKey: 'dateGenEnd',
          filterValue: this.$utils.dateToDateStr(this.searchForm.dateGen[1])
        });
      }
      if (this.searchForm.dateExpire && this.searchForm.dateExpire.length > 0) {
        this.tableData.filterList.push({
          filterKey: 'dateExpireStart',
          filterValue: this.$utils.dateToDateStr(this.searchForm.dateExpire[0])
        });
        this.tableData.filterList.push({
          filterKey: 'dateExpireEnd',
          filterValue: this.$utils.dateToDateStr(this.searchForm.dateExpire[1])
        });
      }
      if (this.searchForm.dateExpire && this.searchForm.dateExpire.length > 0) {
        this.tableData.filterList.push({
          filterKey: 'dateExpireStart',
          filterValue: this.$utils.dateToDateStr(this.searchForm.dateExpire[0])
        });
        this.tableData.filterList.push({
          filterKey: 'dateExpireEnd',
          filterValue: this.$utils.dateToDateStr(this.searchForm.dateExpire[1])
        });
      }

      this.initData();
    },
    initData() {
      this.tableData.list = [];
      this.tableData.total = 0;
      if (this.$route.params.planOrderNumList) {
        if (this.$route.params.planOrderNumList.length > 0) {
          this.searchForm.planOrderNumList = this.$route.params.planOrderNumList
        }
      }
      this.tableData.filterList = [];
      this.tableData.searchOrderStatusList = [];
      if (this.searchForm.inPlanOrderStatus && this.searchForm.inPlanOrderStatus != '' && this.planStatus == 1) {
        this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "inPlanOrderStatus")
        if (this.statusName == 'plan') {
          // this.tableData.filterList.push({filterKey: "status", filterValue: this.searchForm.inPlanOrderStatus})
          this.searchForm.inPlanOrderStatus.forEach((item, index) => {
            this.tableData.searchOrderStatusList.push(...item.split(','))
          })
          // if (this.tableData.searchOrderStatusList.indexOf('00') == -1 || this.tableData.searchOrderStatusList.indexOf('0') == -1) {
          //     this.tableData.filterList.push({ filterKey: 'searchOrderType', filterValue: 'plan'})
          // } else {
          //     this.tableData.filterList.push({ filterKey: 'searchOrderType', filterValue: 'plan,draft'})
          // }
          this.tableData.searchOrderStatusList.forEach((item, index) => {
            if (item.length == 2) {
              if (item == '00' || item == '01' || item == '02' || item == '03') {
                this.tableData.searchOrderStatusList[index] = item.slice(1, 2)
              }
              this.tableData.searchOrderStatusList = [...new Set(this.tableData.searchOrderStatusList)]
            } else {
              this.tableData.searchOrderStatusList[index] = item
            }
          })
        } else {
          this.searchForm.inPlanOrderStatus.forEach((item, index) => {
            this.tableData.searchOrderStatusList.push(...item.split(','))
          })
          // if (this.tableData.searchOrderStatusList.indexOf('00') == -1 || this.tableData.searchOrderStatusList.indexOf('0') == -1) {
          //     this.tableData.filterList.push({ filterKey: 'searchOrderType', filterValue: 'draft'})
          // } else {
          //     this.tableData.filterList.push({ filterKey: 'searchOrderType', filterValue: 'plan,draft'})
          // }
          this.tableData.searchOrderStatusList.forEach((item, index) => {
            if (item.length == 2) {
              if (item == '00' || item == '01' || item == '02' || item == '03') {
                this.tableData.searchOrderStatusList[index] = item.slice(1, 2)
              }
              this.tableData.searchOrderStatusList = [...new Set(this.tableData.searchOrderStatusList)]
            } else {
              this.tableData.searchOrderStatusList[index] = item
            }
          })
        }
      }
      if (this.searchForm.inPlanOrderStatus && this.searchForm.inPlanOrderStatus != '' && this.planStatus == 2) {
        this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "inPlanOrderStatus")
        console.log(this.searchForm.inPlanOrderStatus);
        this.searchForm.inPlanOrderStatus.forEach((item, index) => {
          this.tableData.searchOrderStatusList.push(...item.split(','))
        })
      }
      if (this.searchForm.inPlanOrderStatus && this.searchForm.inPlanOrderStatus != '' && this.planStatus == 3) {
        this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "inPlanOrderStatus")
        // this.tableData.filterList.push({filterKey: "finishSign", filterValue: this.searchForm.inPlanOrderStatus})
        this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "inPlanOrderStatus")
        this.searchForm.inPlanOrderStatus.forEach((item, index) => {
          this.tableData.searchOrderStatusList.push(...item.split(','))
        })
      }
      if (this.searchForm.inPlanOrderStatus && this.searchForm.inPlanOrderStatus != '' && this.planStatus == 4) {
        this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "inPlanOrderStatus")
        // this.tableData.filterList.push({filterKey: "status", filterValue: this.searchForm.inPlanOrderStatus})
        this.searchForm.inPlanOrderStatus.forEach((item, index) => {
          this.tableData.searchOrderStatusList.push(...item.split(','))
        })
      }
      if (this.searchForm.startArrivedDate && this.searchForm.startArrivedDate.length > 0 && this.searchForm.startArrivedDate[0] !== '') {
        this.searchForm.startArrivedDate.forEach((item, index) => {
          var str = item.toString();
          str = str.replace(/ GMT.+$/, '');// Or str = str.substring(0, 24)
          var d = new Date(str);
          var a = [d.getFullYear(), d.getMonth() + 1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds()];
          for (var i = 0, len = a.length; i < len; i++) {
            if (a[i] < 10) {
              a[i] = '0' + a[i];
            }
          }
          str = a[0] + '-' + a[1] + '-' + a[2]
          if (index == 0) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "startArrivedTime")
            this.tableData.filterList.push({filterKey: "startArrivedTime", filterValue: str})
          } else if (index == 1) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "endArrivedTime")
            this.tableData.filterList.push({filterKey: "endArrivedTime", filterValue: str})
          }
        })
      }
      if (this.searchForm.endRegisterDate && this.searchForm.endRegisterDate.length > 0 && this.searchForm.endRegisterDate[0] !== '') {
        this.searchForm.endRegisterDate.forEach((item, index) => {
          var str = item.toString();
          str = str.replace(/ GMT.+$/, '');// Or str = str.substring(0, 24)
          var d = new Date(str);
          var a = [d.getFullYear(), d.getMonth() + 1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds()];
          for (var i = 0, len = a.length; i < len; i++) {
            if (a[i] < 10) {
              a[i] = '0' + a[i];
            }
          }
          str = a[0] + '-' + a[1] + '-' + a[2]
          if (index == 0) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "startInTime")
            this.tableData.filterList.push({filterKey: "startInTime", filterValue: str})
          } else if (index == 1) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "endInTime")
            this.tableData.filterList.push({filterKey: "endInTime", filterValue: str})
          }
        })
      }
      if (this.searchForm.expectedDelivery && this.searchForm.expectedDelivery.length > 0 && this.searchForm.expectedDelivery[0] !== '') {
        this.searchForm.expectedDelivery.forEach((item, index) => {
          var str = item.toString();
          str = str.replace(/ GMT.+$/, '');// Or str = str.substring(0, 24)
          var d = new Date(str);
          var a = [d.getFullYear(), d.getMonth() + 1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds()];
          for (var i = 0, len = a.length; i < len; i++) {
            if (a[i] < 10) {
              a[i] = '0' + a[i];
            }
          }
          str = a[0] + '-' + a[1] + '-' + a[2]
          if (index == 0) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "outStartEstimateDate")
            this.tableData.filterList.push({filterKey: "outStartEstimateDate", filterValue: str})
          } else if (index == 1) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "outEndEstimateDate")
            this.tableData.filterList.push({filterKey: "outEndEstimateDate", filterValue: str})
          }
        })
      }
      if (this.searchForm.goodsTransfer && this.searchForm.goodsTransfer.length > 0 && this.searchForm.goodsTransfer[0] !== '') {
        this.searchForm.goodsTransfer.forEach((item, index) => {
          var str = item.toString();
          str = str.replace(/ GMT.+$/, '');// Or str = str.substring(0, 24)
          var d = new Date(str);
          var a = [d.getFullYear(), d.getMonth() + 1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds()];
          for (var i = 0, len = a.length; i < len; i++) {
            if (a[i] < 10) {
              a[i] = '0' + a[i];
            }
          }
          str = a[0] + '-' + a[1] + '-' + a[2]
          if (index == 0) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "startTime")
            this.tableData.filterList.push({filterKey: "startTime", filterValue: str})
          } else if (index == 1) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "endTime")
            this.tableData.filterList.push({filterKey: "endTime", filterValue: str})
          }
        })
      }
      if (this.searchForm.exWarehouse && this.searchForm.exWarehouse.length > 0 && this.searchForm.exWarehouse[0] !== '') {
        this.searchForm.exWarehouse.forEach((item, index) => {
          var str = item.toString();
          str = str.replace(/ GMT.+$/, '');// Or str = str.substring(0, 24)
          var d = new Date(str);
          var a = [d.getFullYear(), d.getMonth() + 1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds()];
          for (var i = 0, len = a.length; i < len; i++) {
            if (a[i] < 10) {
              a[i] = '0' + a[i];
            }
          }
          str = a[0] + '-' + a[1] + '-' + a[2]
          if (index == 0) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "sBusinessDate")
            this.tableData.filterList.push({filterKey: "outStartSDate", filterValue: str})
          } else if (index == 1) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "eBusinessDate")
            this.tableData.filterList.push({filterKey: "outStartEndDate", filterValue: str})
          }
        })
      }
      if (this.searchForm.colorSeparation && this.searchForm.colorSeparation.length > 0 && this.searchForm.colorSeparation[0] !== '') {
        this.searchForm.colorSeparation.forEach((item, index) => {
          var str = item.toString();
          str = str.replace(/ GMT.+$/, '');// Or str = str.substring(0, 24)
          var d = new Date(str);
          var a = [d.getFullYear(), d.getMonth() + 1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds()];
          for (var i = 0, len = a.length; i < len; i++) {
            if (a[i] < 10) {
              a[i] = '0' + a[i];
            }
          }
          str = a[0] + '-' + a[1] + '-' + a[2]
          if (index == 0) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "sBusinessDate")
            this.tableData.filterList.push({filterKey: "startBusinessDate", filterValue: str})
          } else if (index == 1) {
            this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "eBusinessDate")
            this.tableData.filterList.push({filterKey: "endBusinessDate", filterValue: str})
          }
        })
      }
      if (this.searchForm.businessType) {
        this.tableData.filterList.push({
          filterKey: 'businessType',
          filterValue: this.searchForm.businessType
        });
      }
      this.tableData.filterList = this.tableData.filterList.filter(item => item.filterKey != "customerCode")
      // this.tableData.filterList.push({filterKey: "ownerCode", filterValue: this.$utils.getUserInfo().entrustingPartyCode})
      // this.tableData.filterList.push({filterKey: "cargoOwner", filterValue: this.$utils.getUserInfo().entrustingPartyCode})
      let body
      if (this.$route.params.planOrderNumList == undefined || this.$route.params.planOrderNumList.length == 0) {
        if (this.searchForm.planOrderNumList != undefined && this.searchForm.planOrderNumList != '') {
          this.searchForm.planOrderNumList = this.searchForm.planOrderNumList.split(',');
        }
      }
      if (this.searchForm.planOrderNumList) {
        body = {
          ...this.getOwnerParams(this.tableData.filterList),
          pageNum: this.tableData.pageNum,
          pageSize: this.tableData.pageSize,
          searchKey: this.tableData.searchKey,
          sortList: this.tableData.sortList,
          planOrderNumList: this.searchForm.planOrderNumList,
          searchOrderType: "",
          searchOrderTypeList: [],
          searchOrderStatusList: this.tableData.searchOrderStatusList,
          notInMatTypeCodeList: [
            "9999",
            "0001"
          ]
        };
      } else {
        body = {
          ...this.getOwnerParams(this.tableData.filterList),
          pageNum: this.tableData.pageNum,
          pageSize: this.tableData.pageSize,
          searchKey: this.tableData.searchKey,
          sortList: this.tableData.sortList,
          searchOrderType: "",
          searchOrderTypeList: [],
          searchOrderStatusList: this.tableData.searchOrderStatusList,
          notInMatTypeCodeList: [
            "9999",
            "0001"
          ]
        };
      }

      // boweight.matNameList = ['冻藏的整头及半头羔羊肉'];
      if (this.matSelected && this.matSelected.length > 0) {
        body.matNameList = this.matSelected.map(x => x.matName);
      }
      if (this.cancel) {
        this.cancel();
      }
      let aCancelToken = new axios.CancelToken((c) => {
          this.cancel = c;
        }
      );
      this.tableData.loading = true;
      console.log(2323, this.planStatus);
      if (this.planStatus == 1) {
        // this.tableData.filterList.forEach((item) => {
        //     if (item.filterKey === 'ownerCode') {
        //         item.filterKey = 'cargoOwner'
        //     }
        // })
        if (this.completeOrderInfoH.length > 0) {
          body.applyType = 'in'
          this.$nextTick(() => {
            selectBoxNumPage(body, this.wmsUrl, aCancelToken).then(({data}) => {
              this.wareList.forEach((item, index) => {
                if (item.whId == this.menuActiveName) {
                  this.completeOrderInfoH[index] = data.returnCode === 200 ? data.returnData.boxNum : 0;
                }
              });
            })
          })
        }
        console.log(232323,this.wmsUrl)
        getWarehousingList(body, this.wmsUrl, aCancelToken).then(({data}) => {
          if (data.returnCode === 200) {
            data.returnData.pageInfo.list.forEach(x => {
              x.checked = false;

            });
            this.tableData.list = data.returnData.pageInfo.list;
            this.tableData.total = data.returnData.pageInfo.total;
            this.tableData.list.forEach(x => {
              this.$set(x, 'dtailInfo', false);
            })
          } else {
            this.$Message.error(data.returnMsg);
          }
        }).catch(() => {
          this.$Message.error('err');
        }).finally(() => {
          this.tableData.loading = false;
        });
      } else if (this.planStatus == 2) {
        if (this.completeOrderInfoH.length > 0) {
          body.applyType = 'out'
          this.$nextTick(() => {
            selectBoxNumPage(body, this.wmsUrl, aCancelToken).then(({data}) => {
              this.wareList.forEach((item, index) => {
                if (item.whId == this.menuActiveName) {
                  this.completeOrderInfoH[index] = data.returnCode === 200 ? data.returnData.boxNum : 0;
                }
              });
            })
          })
        }
        getExWarehouseList(body, this.wmsUrl, aCancelToken).then(({data}) => {
          if (data.returnCode === 200) {
            // data.returnData.pageInfo.list.forEach(x => {
            //     x.checked = false;
            // });
            // console.log(this.tableData.list,'data.returnData.pageInfo.list')
            this.tableData.list = data.returnData.pageInfo.list;
            this.tableData.total = data.returnData.pageInfo.total;
            this.tableData.list.forEach(x => {
              this.$set(x, 'dtailInfo', false)
              // getExWarehouseInfo({outPlanOrderNum:x.outPlanOrderNum},this.wmsUrl, aCancelToken).then(({ data }) => {
              //     // x.warehousing = data.returnData
              //     this.$set(x,'warehousing',data.returnData)
              //     console.log(this.tableData.list,'data.returnData.pageInfo.list')
              // })
            })
          } else {
            this.$Message.error(data.returnMsg);
          }
        }).finally(() => {
          this.tableData.loading = false;
        });
      } else if (this.planStatus == 3) {
        this.tableData.list = [];
        this.tableData.total = 0;
        this.tableDataTC.list = [];
        this.tableDataTC.total = 0;
        body.applyType = 'prop'
        if (this.completeOrderInfoH.length > 0) {
          this.$nextTick(() => {
            selectBoxNumPage(body, this.wmsUrl, aCancelToken).then(({data}) => {
              this.wareList.forEach((item, index) => {
                if (item.whId == this.menuActiveName) {
                  if (data.returnCode === 200) {
                    this.completeOrderInfoH[index] = data.returnData.containerNumCount + '柜/' + data.returnData.boxNum + '货品'
                  } else {
                    this.completeOrderInfoH[index] = '0柜/0货品';
                  }
                }
              });
            })
          })
        }
        getPage(body, this.wmsUrl, aCancelToken).then(({data}) => {
          if (data.returnCode === 200) {
            if (data.returnData.pageInfo.list != null) {
              data.returnData.pageInfo.list.forEach((item) => {
                // if (item.list != null) {
                this.$set(item, 'dtailInfo', false)
                // console.log(this.tableDataHZList);
                // }
              })
            }
            data.returnData.pageInfo.list.forEach(x => {
              x.checked = false;
            });
            if (this.wmsUrl === 'http://192.168.89.159:8096') {
              this.tableData.list = data.returnData.pageInfo.list;
              this.tableData.total = data.returnData.pageInfo.total;
            } else {
              this.tableDataTC.list = data.returnData.pageInfo.list;
              this.tableDataTC.total = data.returnData.pageInfo.total;
              this.tableData.list = this.tableDataTC.list;
              this.tableData.total = this.tableDataTC.total;
            }
          } else {
            this.$Message.error(data.returnMsg);
          }
        }).finally(() => {
          this.tableData.loading = false;
        });
      } else if (this.planStatus == 4) {
        body = {
          ...this.getOwnerParams(this.tableData.filterList),
          pageNum: this.tableData.pageNum,
          pageSize: this.tableData.pageSize,
          searchKey: this.tableData.searchKey,
          sortList: this.tableData.sortList,
          searchOrderType: "",
          searchOrderTypeList: [],
          searchOrderStatusList: this.tableData.searchOrderStatusList,
          notInMatTypeCodeList: [
            "9999",
            "0001"
          ]
        }
        this.tableData.list = [];
        this.tableData.total = 0;
        body.applyType = 'sep'
        if (this.completeOrderInfoH.length > 0) {
          this.$nextTick(() => {
            selectBoxNumPage(body, this.wmsUrl, aCancelToken).then(({data}) => {
              this.wareList.forEach((item, index) => {
                if (item.whId == this.menuActiveName) {
                  this.completeOrderInfoH[index] = data.returnCode === 200 ? data.returnData.boxNum : 0;
                }
              });
            })
          })
        }
        getColorSeparationList(body, this.wmsUrl, aCancelToken).then(({data}) => {
          if (data.returnCode === 200) {
            data.returnData.pageInfo.list.forEach(x => {
              x.checked = false;
            });
            this.tableData.list = data.returnData.pageInfo.list;
            this.tableData.total = data.returnData.pageInfo.total;
            this.tableData.list.forEach(x => {
              this.$set(x, 'dtailInfo', false)
              this.$set(x, 'orderSelect', '分色前明细')
              // getColorSepa,rationInfo({orderNum:x.orderNum},this.wmsUrl, aCancelToken).then(({ data }) => {
              //     // x.warehousing = data.returnData
              //     this.$set(x,'warehousing',data.returnData)
              //     console.log(this.tableData.list,'data.returnData.pageInfo.list')
              // })
            })
          } else {
            this.$Message.error(data.returnMsg);
          }
        }).finally(() => {
          this.tableData.loading = false;
          if (this.tableData.list.length !== thmenuSelectis.orderSelect.length) {
            this.tableData.list.forEach(item => {
              this.orderSelect.push('分色前明细');
            });
          }
        });
      }
      // this.selectCustomerInfoByDto();
    },
    menuSelect(name) {
      this.tableData.pageNum = 1;
      this.menuActiveName = name;
      if (this.$route.params.planInfoStatus == undefined) {
        this.searchForm = {
          ownerCodeList: this.getOwnerCodeListDefault(),
          inPlanOrderStatus: null,
          startArrivedDate: [],
          endRegisterDate: [],
          colorSeparation: [],
          goodsTransfer: [],
          exWarehouse: [],
          expectedDelivery: [],
          planOrderNumList: this.searchForm.planOrderNumList
        }
        if (!this.$route.params.batchAttr07) {
          this.tableData.searchKey = ''
        } else {
          this.$route.params.batchAttr07 = null;
          this.$route.params.menuActiveName = null
        }
      }
    },
    pageChange(pageNum) {
      this.tableData.pageNum = pageNum;
      this.initData();
    },
    pageSizeChange(pageSize) {
      this.tableData.pageSize = pageSize;
      this.initData();
    },
    attachmentPageChange(pageNum) {
      this.pageData.pageNum = pageNum;
      this.getViewInfo(this.selectRowItem);
    },
    attachmentPageSizeChange(pageSize) {
      this.pageData.pageSize = pageSize;
      this.getViewInfo(this.selectRowItem);
    },
    resetAttachment() {
      this.attachmentItem = {};
      this.getViewInfo(this.selectRowItem);
    },
    getViewInfo(item) {
      if (this.menuActiveName != 36) {
        this.pageData.list = [];
        this.dialogTableVisible = true
        this.selectRowItem = item;
        let body
        if (this.planStatus == 1) {
          this.dialogTableTitle = '入库计划附件';
          body = {
            pageNum: this.pageData.pageNum,
            pageSize: this.pageData.pageSize,
            sortList: [{
              sortKey: "createdDate",
              sortValue: "desc"
            }],
            filterList: [],
            selectCustomerCode: "",
            businessNum: item.orderNum,
            selectType: 'into',
            fileTypeList: ["5", "7"],
            // searchKey: this.attachmentItem.searchKey
          }
        } else if (this.planStatus == 2) {
          this.dialogTableTitle = '出库计划附件';
          body = {
            pageNum: this.pageData.pageNum,
            pageSize: this.pageData.pageSize,
            sortList: [{
              sortKey: "createdDate",
              sortValue: "desc"
            }],
            fileTypeList: ["5", "7"],
            filterList: [],
            selectCustomerCode: "",
            businessNum: item.outPlanOrderNum ? item.outPlanOrderNum : item.id,
            selectType: 'out',
            // searchKey: this.attachmentItem.searchKey
          }
        } else if (this.planStatus == 3) {
          this.dialogTableTitle = '货转计划附件';
          body = {
            pageNum: this.pageData.pageNum,
            pageSize: this.pageData.pageSize,
            sortList: [{
              sortKey: "createdDate",
              sortValue: "desc"
            }],
            fileTypeList: ["5", "7"],
            filterList: [],
            selectCustomerCode: "",
            businessNum: item.changeOrderNum,
            selectType: 'prop',
            // searchKey: this.attachmentItem.searchKey
          }
        } else if (this.planStatus == 4) {
          this.dialogTableTitle = '分色计划附件';
          body = {
            pageNum: this.pageData.pageNum,
            pageSize: this.pageData.pageSize,
            sortList: [{
              sortKey: "createdDate",
              sortValue: "desc"
            }],
            fileTypeList: ["5", "7"],
            filterList: [],
            selectCustomerCode: "",
            businessNum: item.orderNum,
            selectType: 'sep',
            // searchKey: this.attachmentItem.searchKey
          }
        }
        this.pageData.loading = true;
        REdoc(body, this.wmsUrl).then(({data}) => {
          if (data.returnCode === 200) {
            console.log(data);
            data.returnData.pageInfo.list.forEach((item) => {
              item.createdDate = this.$utils.timestampToDate(item.createdDate)
            })
            this.pageData.list = data.returnData.pageInfo.list
            this.pageData.total = data.returnData.pageInfo.total;
            this.pageData.list.forEach(gridItem => {
              gridItem.containerNum = item.containerNum;
              gridItem.carNo = item.carNo;
            })
          }
        }).finally(() => {
          this.pageData.loading = false;
        })
      } else if (this.menuActiveName == 36) {
        if (item) {
          this.searchItem = item;
        }
        this.dialogTableVisible = true
        if (this.planStatus == 4) {
          let body = {
            "pageNum": 1,
            "pages": 1,
            "pageSize": 50,
            "pageOptionsList": [
              50,
              100,
              200
            ],
            "total": 0,
            "sortList": [],
            "filterList": [],
            "selectCustomerCode": "",
            "selectOutPlanOrderNum": "",
            "ccisPledgePlanId": "", //报关申请id, 货转申请id
            "ccisSeparationPlanId": item.orderNum ? item.orderNum : "", //分色申请id
            "searchOrderType": "",
            searchName: this.attachmentItem.searchKey
          }
          getFileList(body, this.wmsUrl).then(({data}) => {
            if (data.returnCode == 200) {
              this.pageData.list = data.returnData.pageInfo.list
              this.pageData.list.forEach(item => {
                item.createdDate = this.$utils.timestampToDate(item.createdDate);
              });
            }
          })
        } else if (this.planStatus == 3) {
          let body = {
            "pageNum": 1,
            "pages": 1,
            "pageSize": 50,
            "pageOptionsList": [
              50,
              100,
              200
            ],
            "total": 0,
            "sortList": [],
            "filterList": [],
            "selectCustomerCode": "",
            "selectOutPlanOrderNum": "",
            "ccisPledgePlanId": item.changeOrderNum ? item.changeOrderNum : "", //报关申请id, 货转申请id
            "ccisSeparationPlanId": "", //分色申请id
            "searchOrderType": "",
            searchName: this.attachmentItem.searchKey
          }
          getFileList(body, this.wmsUrl).then(({data}) => {
            if (data.returnCode == 200) {
              this.pageData.list = data.returnData.pageInfo.list
              this.pageData.list.forEach(item => {
                item.createdDate = this.$utils.timestampToDate(item.createdDate);
              });
            }
          })
        } else if (this.planStatus == 1) {
          this.selectRowItem = item;
          this.dialogTableTitle = '入库计划附件';
          let body = {
            pageNum: this.pageData.pageNum,
            pageSize: this.pageData.pageSize,
            sortList: [{
              sortKey: "createdDate",
              sortValue: "desc"
            }],
            filterList: [],
            selectCustomerCode: "",
            selectInPlanOrderNum: item.orderNum,
            fileTypeList: ["5"],
            searchKey: this.attachmentItem.searchKey
          }
          REdoc(body, this.wmsUrl).then(({data}) => {
            if (data.returnCode === 200) {
              data.returnData.pageInfo.list.forEach((item) => {
                item.createdDate = this.$utils.timestampToDate(item.createdDate)
              })
              this.pageData.list = data.returnData.pageInfo.list
              this.pageData.total = data.returnData.pageInfo.total;
              this.pageData.list.forEach(gridItem => {
                gridItem.containerNum = item.containerNum;
                gridItem.carNo = item.carNo;
              })
            }
          }).finally(() => {
            this.pageData.loading = false;
          })
        } else if (this.planStatus == 2) {
          this.selectRowItem = item;
          this.dialogTableTitle = '出库计划附件';
          let body = {
            pageNum: this.pageData.pageNum,
            pageSize: this.pageData.pageSize,
            sortList: [{
              sortKey: "createdDate",
              sortValue: "desc"
            }],
            fileTypeList: ["5"],
            filterList: [],
            selectCustomerCode: "",
            selectOutPlanOrderNum: item.outPlanOrderNum,
            searchKey: this.attachmentItem.searchKey
          }
          REdoc(body, this.wmsUrl).then(({data}) => {
            if (data.returnCode === 200) {
              data.returnData.pageInfo.list.forEach((item) => {
                item.createdDate = this.$utils.timestampToDate(item.createdDate)
              })
              this.pageData.list = data.returnData.pageInfo.list
              this.pageData.total = data.returnData.pageInfo.total;
              this.pageData.list.forEach(gridItem => {
                gridItem.containerNum = item.containerNum;
                gridItem.carNo = item.carNo;
              })
            }
          }).finally(() => {
            this.pageData.loading = false;
          })
        }
      }
    },
    creteadInfo() {
      window.localStorage.removeItem('EditInfocode')
      this.$nextTick(() => {
        if (this.planStatus == 4) {
          this.$router.push({
            name: 'sepPlanInfo',
            query: {
              menuActiveName: JSON.stringify(this.menuActiveName),
              wareList: JSON.stringify(this.wareList),
              wmsUrl: JSON.stringify(this.wmsUrl),
              editItemWarehousing: JSON.stringify(this.editItemWarehousing),
              editItem: JSON.stringify(this.editItem),
              orderItem: JSON.stringify(this.orderItem)
            }
          })
          return
        } else if (this.planStatus == 1) {
          this.$router.push({
            name: 'inPlanInfo',
            query: {
              menuActiveName: JSON.stringify(this.menuActiveName),
              wareList: JSON.stringify(this.wareList),
              wmsUrl: JSON.stringify(this.wmsUrl),
              editItemWarehousing: JSON.stringify(this.editItemWarehousing),
              editItem: JSON.stringify(this.editItem),
              editStatus: JSON.stringify('edit')
            }
          })
          return
        } else if (this.planStatus == 2) {
          this.$router.push({
            name: 'OutPlanInfo',
            query: {
              menuActiveName: JSON.stringify(this.menuActiveName),
              wareList: JSON.stringify(this.wareList),
              wmsUrl: JSON.stringify(this.wmsUrl),
              editItemWarehousing: JSON.stringify(this.editItemWarehousing),
              editItem: JSON.stringify(this.editItem),
              ccisCustomerCode: JSON.stringify(this.ccisCustomerCode),
              editStatus: JSON.stringify('edit'),
              escort: JSON.stringify('0')
            }
          })
          return
        } else if (this.planStatus == 3) {
          this.$router.push({
            name: 'goodsTransfer',
            query: {
              menuActiveName: JSON.stringify(this.menuActiveName),
              wareList: JSON.stringify(this.wareList),
              wmsUrl: JSON.stringify(this.wmsUrl),
              item: JSON.stringify(this.item),
              list: JSON.stringify(this.list),
              ccisCustomerCode: JSON.stringify(this.ccisCustomerCode),
            }
          })
          return
        }
        this.orderItem = {}
        this.EditItem = null;
        this.editItemWarehousing = null;
        this.item = null;
        // if(this.$route.params.planStatus) {
        this.isShow = !this.isShow;
        // }
        this.$nextTick(() => {
          this.initData()
        })
      })
    },
    handleSelectionChange(selection) {
      this.selection = selection;
    },
    fristInit() {
      if (this.$route.params.planInfoStatus != undefined) {
        this.planStatus = this.$route.params.planInfoStatus
      }
      ;
      this.$nextTick(() => {
        if (this.$route.params.planInfoStatus == 1) {
          this.tableData.filterList.push({filterKey: 'searchOrderType', filterValue: 'plan'})
          this.columnsAddList = [
            {lcatValue: '00', lcatName: '草稿', status: 'draft'},
            {lcatValue: '01', lcatName: '已提交', status: 'draft'},
            {lcatValue: '02', lcatName: '驳回', status: 'draft'},
            {lcatValue: '0,12,05', lcatName: '未开始', status: 'plan'},
            {lcatValue: '3', lcatName: '进行中', status: 'plan'},
            {lcatValue: '11,6,10,4', lcatName: '已完成', status: 'plan'},
            // {lcatValue:'15',lcatName: '已取消', status: 'plan'},
            // {lcatValue:'16',lcatName: '待确认', status: 'plan'},

            // {lcatValue:'03',lcatName:'申请成功', status: 'draft'},
          ]
          this.searchForm.inPlanOrderStatus = ["0,12", "3"];
          this.statusChange(['0,12', '3'])
        } else if (this.$route.params.planInfoStatus == 2) {
          this.columnsAddList = [
            {lcatValue: '0', lcatName: '草稿'},
            {lcatValue: '3', lcatName: '驳回'},
            {lcatValue: '1,00', lcatName: '已提交'},
            {lcatValue: '11,05', lcatName: '未开始'},
            {lcatValue: '22,33', lcatName: '进行中'},
            {lcatValue: '44,45,40,41', lcatName: '已完成'},

          ]
          this.searchForm.inPlanOrderStatus = ['00,11', '22,33'];
          this.statusChange(['00,11', '22,33'])
        } else if (this.$route.params.planInfoStatus == 3) {
          this.columnsS = [
            {lcatValue: '0', lcatName: '草稿'},
            {lcatValue: '2', lcatName: '已提交'},
            {lcatValue: '5', lcatName: '驳回'},
            {lcatValue: '3', lcatName: '货转中'},
            {lcatValue: '4', lcatName: '货转完成'},
            {lcatValue: '6', lcatName: '已受理'}
          ]
          this.searchForm.inPlanOrderStatus = ['3'];
          this.statusChange(['3'])
        } else if (this.$route.params.planInfoStatus == 4) {
          this.columnsFS = [
            // {lcatValue:'20',lcatName:'执行中'},
            {lcatValue: '0', lcatName: '草稿'},
            {lcatValue: '1', lcatName: '已提交'},
            {lcatValue: '2', lcatName: '驳回'},
            {lcatValue: '10', lcatName: '未开始'},
            {lcatValue: '13,30,20', lcatName: '进行中'},
            {lcatValue: '40,55,45', lcatName: '已完成'},
          ]
          this.searchForm.inPlanOrderStatus = ['10', '13,30,20'];
          this.statusChange(['10', '13,30,20'])
        }
      })
    },

    getOwnerCodeListDefault() {
      return this.$utils.getUserInfo().currentAgentPermission
        ? this.$utils.getUserInfo().customerInfoList.map(i => i.customerPartyCode)
        : [this.$utils.getUserInfo().entrustingPartyCode];
    },
    getOwnerParams(filterList) {
      const ccisCustomerCodeList = this.searchForm.ownerCodeList;
      const _filterList_ = [
        {
          filterKey: "cargoOwner",
          filterValue: this.$utils.getUserInfo().entrustingPartyCode

        },
        {
          filterKey: "ownerCode",
          filterValue: this.$utils.getUserInfo().entrustingPartyCode
        }
      ];

      filterList = filterList || [];
      if (this.$utils.getUserInfo().currentAgentPermission) {
        return {filterList, ccisCustomerCodeList};
      } else {
        filterList.push(..._filterList_);
        return {filterList};
      }
    },
    init() {
      if (this.$route.params.menuActiveName == 27) {
      } else {
        if (this.$route.query.planNum != undefined) {
          this.matClick(this.$route.query.planNum)
        } else {
          // this.columnsAddList = _.cloneDeep(this.columnsAddListR)
          this.matClick(this.planStatus)
        }
      }
      // getCompleteOrderInfoJian([26])
      // this.getDictData()
      this.$nextTick(() => {
        if (this.$route.params.planStatus) {
          this.planStatus = this.$route.params.planStatus
        }
        this.initData();
      })
    },
    initWareList(val) {
      this.wareSelected = val.filter(x => x.checked);
      this.wareAllChecked = this.wareSelected.length === this.wareList.length;
      getCompleteOrderInfo(this.wareList.map(x => x.whId)).then(res => {
        if (res.data.returnCode == 200) {
          this.completeOrderInfo = res.data.returnData
          this.runningNumR = 0
          this.source = 0
          this.boxNumR = 0
          this.WeightR = 0
          this.runningNumC = 0
          this.boxNumC = 0
          this.WeightC = 0
          this.runningNumH = 0
          this.boxNumH = 0
          this.WeightH = 0
          this.runningNumF = 0
          this.boxNumF = 0
          this.WeightF = 0
          this.qtyF = 0
          this.qtyH = 0,
            this.completeOrderInfo.forEach((item, index) => {
              if (this.wareList[index].checked) {
                if (item.inPlan !== null) {
                  this.runningNumR += item.inPlan.runningNum
                  this.boxNumR += item.inPlan.boxNum
                  this.WeightR += item.inPlan.weight * 1
                }
                if (item.outPlan !== null) {
                  this.runningNumC += item.outPlan.runningNum
                  this.boxNumC += item.outPlan.boxNum
                  this.WeightC += item.outPlan.weight * 1
                }
                if (item.goodsTransfer !== null) {
                  this.runningNumH += item.goodsTransfer.runningNum
                  this.boxNumH += item.goodsTransfer.boxNum
                  this.WeightH += item.goodsTransfer.weight
                  this.qtyH += item.goodsTransfer.qty
                }
                if (item.colorSeparation !== null) {
                  this.runningNumF += item.colorSeparation.runningNum
                  this.boxNumF += item.colorSeparation.boxNum
                  this.WeightF += item.colorSeparation.weight
                  this.qtyF += item.colorSeparation.qty
                }
              }
            })
          this.wareList.forEach((item, index) => {
            if (this.completeOrderInfo[index] !== undefined) {
              item.completeInfo = this.completeOrderInfo[index]
              if (item.completeInfo.colorSeparation !== null && item.completeInfo.goodsTransfer !== null && item.completeInfo.inPlan !== null && item.completeInfo.outPlan !== null) {
                item.boxNum = item.completeInfo.colorSeparation.boxNum * 1 + item.completeInfo.goodsTransfer.boxNum * 1 + item.completeInfo.inPlan.boxNum * 1 + item.completeInfo.outPlan.boxNum * 1
                item.weight = (((item.completeInfo.colorSeparation.weight / 1000).toFixed(3) * 1 + (item.completeInfo.goodsTransfer.weight / 1000).toFixed(3) * 1 + (item.completeInfo.inPlan.weight / 1000).toFixed(3) * 1 + (item.completeInfo.outPlan.weight / 1000).toFixed(3) * 1)).toFixed(3)
              } else {
                item.boxNum = 0;
                item.weight = 0;
              }
            } else {
              item.boxNum = 0;
              item.weight = 0;
            }
          })
        }
      })
      const wareSelected = this.wareSelected.filter(item => item.ccisCustomerCodeList && item.ccisCustomerCodeList.length);
      if (wareSelected.length > 0) {
        this.menuActiveName = this.initialWhId ? this.initialWhId : wareSelected[0].whId;
        this.initialWhId = null;
        this.$nextTick(() => {
          if (this.$refs.wareMenu) {
            this.$refs.wareMenu.updateActiveName();
          }
        });
      }
      let data = this.wareList.filter(x => x.id === this.menuActiveName);
      this.tableData.searchOrderStatusList = [];
      this.tableData.filterList = [];
      this.tableData.inPlanOrderStatus = null;
    }
  },
  created() {
    // this.fullscreenLoading = true;
  },
  async mounted() {
    this.ccisCustomerCodeListFlagLoading = true

    await this.complete;
    this.$set(this.searchForm, 'ownerCodeList', this.getOwnerCodeListDefault());

    if (this.$route.params.planStatus) {
      // this.initialWhId = this.$route.params.whIdList[0];
      this.planStatus = this.$route.params.planStatus
      this.$nextTick(() => {
        setTimeout(() => {
          this.creteadInfo()
        }, 600)
      })
    }
    if (this.$route.query.planNum) {
      this.planStatus = this.$route.query.planNum * 1
    }
    this.fristInit();
    this.getAllWare();
  },
  watch: {
    wareList: {
      handler(val) {
        this.initWareList(val);
      },
      deep: true,
      immediate: true
    },
    planStatus: {
      handler(val) {
        this.$nextTick(() => {
          if (val == 1) {
            this.tableData.filterList.push({filterKey: 'searchOrderType', filterValue: 'plan'})
            this.columnsAddList = [
              {lcatValue: '00', lcatName: '草稿', status: 'draft'},
              {lcatValue: '01', lcatName: '已提交', status: 'draft'},
              {lcatValue: '02', lcatName: '驳回', status: 'draft'},
              {lcatValue: '0,12,05', lcatName: '未开始', status: 'plan'},
              {lcatValue: '3', lcatName: '进行中', status: 'plan'},
              {lcatValue: '11,6,10,4', lcatName: '已完成', status: 'plan'},
              // {lcatValue:'15',lcatName: '已取消', status: 'plan'},
              // {lcatValue:'16',lcatName: '待确认', status: 'plan'},

              // {lcatValue:'03',lcatName:'申请成功', status: 'draft'},
            ]
          } else if (val == 2) {
            this.columnsAddList = [
              {lcatValue: '0', lcatName: '草稿'},
              {lcatValue: '3', lcatName: '驳回'},
              {lcatValue: '1,00', lcatName: '已提交'},
              {lcatValue: '11,05', lcatName: '未开始'},
              {lcatValue: '22,33', lcatName: '进行中'},
              {lcatValue: '44,45,40,41', lcatName: '已完成'},

            ]
          } else if (val == 3) {
            this.columnsS = [
              {lcatValue: '0', lcatName: '草稿'},
              {lcatValue: '2', lcatName: '已提交'},
              {lcatValue: '5', lcatName: '驳回'},
              {lcatValue: '3', lcatName: '货转中'},
              {lcatValue: '4', lcatName: '货转完成'},
              {lcatValue: '6', lcatName: '已受理'}
            ]
          } else if (val == 4) {
            this.columnsFS = [
              // {lcatValue:'20',lcatName:'执行中'},
              {lcatValue: '0', lcatName: '草稿'},
              {lcatValue: '1', lcatName: '已提交'},
              {lcatValue: '2', lcatName: '驳回'},
              {lcatValue: '10', lcatName: '未开始'},
              {lcatValue: '13,30,20', lcatName: '进行中'},
              {lcatValue: '40,55,45', lcatName: '已完成'},
            ]
          }
        })
        if (val > 0) {
          this.tableData.searchOrderStatusList = [];
          this.tableData.filterList = [];
          this.tableData.inPlanOrderStatus = null;
          this.initData();
          this.searchForm.inPlanOrderStatus = ''
        } else {
          this.tableData.list = [];
        }
      }
    },
    menuActiveName: {
      handler(val) {
        if (this.$route.params.menuActiveName != null) {
          if (this.$route.params.menuActiveName == 27) {
            this.menuActiveName = 27;
            this.$route.params.menuActiveName = undefined;
          }
          if (this.$route.params.menuActiveName) {
            this.menuActiveName = this.$route.params.menuActiveName * 1
            this.$route.params.menuActiveName = ''
          }
        }
        let data = this.wareList.filter(x => x.id === val);
        this.tableData.searchOrderStatusList = [];
        this.tableData.filterList = [];
        this.tableData.inPlanOrderStatus = null;
        if (data && data.length > 0) {
          this.wmsUrl = data[0].ipProt;
          // this.wmsUrl = 'http://172.16.0.142:8099'
          // this.wmsUrl = 'http://103.203.97.98:19300'
          // this.wmsUrl = 'http://172.16.0.206:8088'
          this.$nextTick(() => {
            this.initData();
          })
        }
      }
    },
    completeOrderInfoH: {
      handler(val) {
      },
      immediate: true,
      deep: true
    },
    '$store.state.user.userInfo': {
      handler(value) {
        if (!value || !value.entrustingPartyCode) return;
        this.resolveComplete();
      },
      deep: true,
      immediate: true
    }
  },
};
</script>

<style lang="less">
.colorInfo {
  color: #4F68E8;
  // &:hover {
  //     color:#6b6c6f
  // }
}

.font-bold {
  font-weight: 700;
}

.font-lolds {
  font-weight: 700;
  z-index: 13;
}

.search-container {
  position: relative;
  background-color: #fff;
  border-bottom: 1px solid rgba(217, 217, 217, 1);

  .warehouse, .stock {
    padding: 0 50px;

    .title {
      color: rgba(0, 0, 0, 0.85);
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 12px;
    }
  }

  .warehouse {
    padding-top: 30px;
  }

  .stock {
    padding-bottom: 30px;
  }

  .warehouse-item {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 270px;
    height: 70px;
    border-radius: 4px;
    border: 1px solid rgba(217, 217, 217, 1);
    background-color: rgba(255, 255, 255, 1);
    padding: 10px 20px;
    color: rgba(0, 0, 0, 0.85);
    margin-right: 10px;
    transition: all .5s;

    &:hover {
      .warehouse-item__checked {
        border: 1px solid rgba(79, 104, 232, 1);
        background-color: rgba(79, 104, 232, 0.1);
      }

      .warehouse-item__not-checked {
        border: 1px solid rgba(217, 217, 217, 1);
        background-color: rgba(255, 255, 255, 1);
      }
    }
  }

  .warehouse-item__checked {
    border: 1px solid rgba(79, 104, 232, 1);
    background-color: rgba(79, 104, 232, 0.1);
  }

  .warehouse-item__not-checked {
    border: 1px solid rgba(217, 217, 217, 1);
    background-color: rgba(255, 255, 255, 1);
  }

  .bottom-btn, .bottom-btn2 {
    cursor: pointer;
    width: 50px;
    height: 0;
    display: block;
    position: absolute;
    left: 50%;
    bottom: -20px;
    border-top: 20px solid #fff;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    text-align: center;
    z-index: 100;
    transition: all .3s;
    font-size: 20px !important;

    &:hover {
      transform: scale(1.2) translateY(1px);
    }

    &:hover + .bottom-btn2 {
      transform: scale(1.2) translateY(2px);
    }

    .ios-menu {
      position: absolute;
      top: -20px;
      right: 4px;
      transition: all .3s;
    }
  }

  .bottom-btn2 {
    width: 52px;
    bottom: -21px;
    border-top: 21px solid rgba(217, 217, 217, 1);
    z-index: 90;
  }
}

.content-container {
  margin-top: 10px;

  .ivu-menu-horizontal.ivu-menu-light:after {
    background: rgba(255, 255, 255, 0);
  }

  .ivu-menu-light.ivu-menu-horizontal .ivu-menu-item-active, .ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu-active, .ivu-menu-light.ivu-menu-horizontal .ivu-menu-item:hover, .ivu-menu-light.ivu-menu-horizontal .ivu-menu-submenu:hover {
    border-bottom: 4px solid rgba(79, 104, 232, 1) !important;
  }

  .nav-tab {
    background-color: #fff;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 30px;
  }

  .operation {
    padding: 20px 50px 10px;
  }

  .content {
    padding: 10px 30px;
  }

  .activeClass {
    border: 1px solid rgba(79, 104, 232, 1);
    background-color: rgba(79, 104, 232, 0.1);
  }

  .item {
    width: 20px
  }
}
</style>
